profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jhiesey/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

feross/simple-peer 5720

📡 Simple WebRTC video, voice, and data channels

feross/awesome-mad-science 938

Delightful npm packages that make you say "wow, didn't know that was possible!"

feross/chrome-net 124

Use the Node `net` API in Chrome Apps

feross/mediasource 124

MediaSource API as a node.js Writable stream

feross/Instant.fm 108

Share music playlists with friends.

feross/oculus-drone 79

Pilot a Parrot AR Drone with the Oculus Rift virtual reality headset!

feross/WireSheep 78

WireSheep shows you each user on the network and all the HTTP requests they're making in a pretty News Feed, a la Facebook.

adventure-js/arcticjs.club 68

The http://arcticjs.club website

feross/cctv.js 40

Watch live visitors using your website.

feross/chrome-dgram 38

Use the Node `dgram` API in Chrome Apps

push eventjhiesey/waterlevel

John Hiesey

commit sha 7cd6947db8cabd14793375e54b57326e9286b3a2

Improve robustness

view details

push time in 12 days

push eventjhiesey/waterlevel

John Hiesey

commit sha f4de250e954e329240512d3b4cc436abc6c53bb8

Update pug

view details

push time in 19 days

issue closedSocketDev/wormhole-crypto

F-Droid

Please release the Android app on F-Droid for degoogled Android users who do not have access to the play store

closed time in a month

trymeouteh

issue commentSocketDev/wormhole-crypto

F-Droid

I think you have this package confused with a different project named 'wormhole'. This is used by https://wormhole.app/ only.

trymeouteh

comment created time in a month

issue openedmcollina/split2

Performance is poor when lines are much longer than stream chunks

Suppose we have lines that are very long (sometimes tens of megabytes each of JSON in my case), and stream chunks of more normal length, say 16kB. That means there can be over 1000 chunks per line. This comes up when trying to fetch the changes stream from NPM's couchdb replication endpoint for example.

Each time a new chunk comes in, it gets appended to this[kLast] and then string.split() get called on the resulting string. This means that string.split() is getting called over 1000 times to find a single newline, so splitting in effect becomes O(n^2) in the length of the line.

The fast way to do this is to search for \n before appending to this[kLast]. Unfortunately that doesn't work properly if you have a delimiter like the default /\r?\n/ that can cross chunk boundaries.

So I don't know if this is something you can easily fix while keeping the same interface. A fast-path option that only works for a single character delimiter, or maybe a fixed delimiter string but not functions or regexes, would be handy.

Do you have any better ideas? Or is this use case out of scope for this package? Or am I doing something else dumb?

created time in 2 months

push eventSocketDev/require-in-the-middle

John Hiesey

commit sha 1bfba94d280bb717a9f8a84b98530c01bad22f01

Disable relative path name

view details

push time in 2 months

create barnchSocketDev/require-in-the-middle

branch : hacky-enhancements

created branch time in 2 months

create barnchSocketDev/module-details-from-path

branch : top-level-default

created branch time in 2 months

Pull request review commentwebtorrent/webtorrent

let store access torrent/file events and figure out paths itself

 File name, as specified by the torrent. *Example: 'some-filename.txt'*  ## `file.path` -File path, as specified by the torrent. *Example: 'some-folder/some-filename.txt'*+File path, including torrent path. *Example: 'my-torrent/some-folder/some-filename.txt'*

This is a breaking change, and doesn't make sense when running in a browser, or in any situation where the torrent isn't backed by a real filesystem.

This will definitely break wormhole for example.

ftreesmilo

comment created time in 2 months

Pull request review commentwebtorrent/webtorrent

let store access torrent/file events and figure out paths itself

 class Torrent extends EventEmitter {      this._rarityMap = new RarityMap(this) +    this.files = this.files.map(file => new File(this, file))     let rawStore = this._preloadedStore     if (!rawStore) {       rawStore = new this._store(this.pieceLength, {-        // opts.torrent is deprecated (replaced by the name property).-        // it doesn't appear to be used by current versions of any stores on npm.-        torrent: {-          infoHash: this.infoHash-        },-        files: this.files.map(file => ({-          path: path.join(this.path, file.path),-          length: file.length,-          offset: file.offset-        })),+        torrent: this,+        path: this.path, // for stores that don't care about torrent+        // files[n].path.startsWith(path) === true+        files: this.files,

I think it makes sense to pass the File objects. But I don't think changing file.path to be absolute is a good idea.

If we require the store to do path.join(opts.path, file.path) that only breaks compatibility with existing stores like fs-chunk-store instead of breaking compatibility with any code that uses webtorrent's file interface.

ftreesmilo

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentwebtorrent/webtorrent

fix: add storeOpts, specify store path, align with docs

 class Torrent extends EventEmitter {      this._rarityMap = new RarityMap(this) +    this.files = this.files.map(file => new File(this, file))+     let rawStore = this._preloadedStore     if (!rawStore) {       rawStore = new this._store(this.pieceLength, {-        // opts.torrent is deprecated (replaced by the name property).-        // it doesn't appear to be used by current versions of any stores on npm.-        torrent: {-          infoHash: this.infoHash-        },-        files: this.files.map(file => ({-          path: path.join(this.path, file.path),-          length: file.length,-          offset: file.offset-        })),+        ...this.storeOpts,+        torrent: this,+        path: this.path,+        files: this.files,

The current change, as discussed here https://github.com/feross/fs-chunk-store/pull/17#discussion_r671794460 requires that the infoHash is in the path name.

I realize this is useful to prevent collisions, but is probably not what casual users want, and if we change it that would have to be in a major version of webtorrent (2.0).

I think we need to think through the logic a bit more carefully. My current rough idea:

  • Don't change the store at all, at least to solve this specific issue
  • Add a new param to the torrent opts: basePath, which you set instead of path if you want the infoHash appended to avoid conflicts. If you set the normal torrentOpts.path option instead the behavior won't change.
  • In _onParsedTorrent, do something like this:
if (!this.path) {
  this.path = path.join(this.basePath || TMP, this.infoHash)
  this.cleanupPath = this.path
}
  • In torrent._destroy, if torrent.cleanupPath is set, recursively delete it here in webtorrent, and set torrent._destroyStoreOnDestroy to false to disable the store's cleanup logic.
ThaUnknown

comment created time in 2 months

Pull request review commentwebtorrent/webtorrent

fix: add storeOpts, specify store path, align with docs

 class Torrent extends EventEmitter {      this.metadata = null     this.store = null+    this.storeOpts = opts.storeOpts

This is good!

ThaUnknown

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentfeross/fs-chunk-store

fix: delete residual folders by specifying relative file paths

 Storage.prototype.close = function (cb) { Storage.prototype.destroy = function (cb) {   const self = this   self.close(function () {-    const tasks = self.files.map(function (file) {-      return function (cb) {-        rimraf(file.path, { maxBusyTries: 10 }, cb)-      }-    })-    parallel(tasks, cb)+    if (self.path) {+      fs.rm(path.resolve(path.join(self.path, self.name)), { recursive: true, maxRetries: 10 }, function (err) {

Some users, like you, want the extra UID to avoid overwriting, but that's just going to be confusing for most users.

At a minimum it should still be possible for webtorrent to keep the current behavior, and in my opinion the current behavior should be the default when torrentOpts.path is set.

Adding the infoHash into the path should happen in webtorrent so it can be controlled there.

ThaUnknown

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentfeross/fs-chunk-store

fix: delete residual folders by specifying relative file paths

 Storage.prototype.close = function (cb) { Storage.prototype.destroy = function (cb) {   const self = this   self.close(function () {-    const tasks = self.files.map(function (file) {-      return function (cb) {-        rimraf(file.path, { maxBusyTries: 10 }, cb)-      }-    })-    parallel(tasks, cb)+    if (self.path) {+      fs.rm(path.resolve(path.join(self.path, self.name)), { recursive: true, maxRetries: 10 }, function (err) {

I'm talking about for example webtorrent desktop, where the torrent path is set to ~/Downloads/ and a torrent may contain paths like 1.txt, aDirectory/2.txt, etc.

The desired (and current) behavior is that these get saved into ~/Downloads/1.txt, ~/Downoads/aDirectory/2.txt, etc.

This is very different from the case I think you're thinking of where each torrent goes into its own directory. In the case I'm describing it's not possible to do reliable cleanup, so we need to somehow disable it in that case.

ThaUnknown

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentfeross/fs-chunk-store

fix: delete residual folders by specifying relative file paths

 Storage.prototype.close = function (cb) { Storage.prototype.destroy = function (cb) {   const self = this   self.close(function () {-    const tasks = self.files.map(function (file) {-      return function (cb) {-        rimraf(file.path, { maxBusyTries: 10 }, cb)-      }-    })-    parallel(tasks, cb)+    if (self.path) {+      fs.rm(path.resolve(path.join(self.path, self.name)), { recursive: true, maxRetries: 10 }, function (err) {

Or any torrent that isn't saved under an infohash. I have an idea I'll propose in your webtorrent PR.

ThaUnknown

comment created time in 2 months

Pull request review commentfeross/fs-chunk-store

fix: delete residual folders by specifying relative file paths

 Storage.prototype.close = function (cb) { Storage.prototype.destroy = function (cb) {   const self = this   self.close(function () {-    const tasks = self.files.map(function (file) {-      return function (cb) {-        rimraf(file.path, { maxBusyTries: 10 }, cb)-      }-    })-    parallel(tasks, cb)+    if (self.path) {+      fs.rm(path.resolve(path.join(self.path, self.name)), { recursive: true, maxRetries: 10 }, function (err) {

How does this work when saving a torrent into a path that doesn't contain the info hash, like ~/Downloads/my_torrent_name?

ThaUnknown

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentfeross/fs-chunk-store

fix: delete residual folders by specifying relative file paths

 function Storage (chunkLength, opts) {           file.offset = prevFile.offset + prevFile.length         }       }+      if (self.path) file.path = path.resolve(path.join(self.path, self.name, file.path))

This logic of resolving file paths relative to self.path/self.name feels too magical to me.

I think self.path should be the real file base path; if the user wants to put the name into the path they can do that outside.

ThaUnknown

comment created time in 2 months

PullRequestReviewEvent

pull request commentwebtorrent/webtorrent

let store access torrent/file events and figure out paths itself

@ftreesmilo sorry I've been a bit busy. Still planning to look at this this week.

ftreesmilo

comment created time in 2 months

push eventjhiesey/webtorrent

valverde82

commit sha ac145e8d56d681fa8e3e46db7b5d3e094ce8f533

Update faq.md Add reference to LiveOnTorrent: a free plataform to live streaming on browser.

view details

Jimmy Wärting

commit sha ee833d0bea0bed55721e7da78e90afda972796b7

Made two array into a set

view details

Feross Aboukhadijeh

commit sha e88feec495240675a439e4b0014dc65db7cd4a6f

FileStream: remove onclose argument to destroy() This is a non-standard interface and it's confusing. It caused a bug in https://wormhole.app

view details

Feross Aboukhadijeh

commit sha 47afe5bbef413780f4b289953af3d6c9ac1861b6

Merge pull request #2030 from webtorrent/onclose FileStream: remove onclose argument to destroy()

view details

Feross Aboukhadijeh

commit sha fb68cd60a0941d2763f9b7d2cb8e714e750c6625

Fix GitHub Actions CI

view details

Feross Aboukhadijeh

commit sha a093880e19576e9451d3a53b6b17195df9daa7c9

Upgrade to Airtap 4

view details

Feross Aboukhadijeh

commit sha 36a79911bd089fb7c90b292dd98b0fee0c86b9c2

Airtap: update browser names

view details

Feross Aboukhadijeh

commit sha 0737789002a15a8b46c1d74c2fd0ff9901a9f5df

Merge pull request #2031 from webtorrent/test

view details

Feross Aboukhadijeh

commit sha 5357e8e2e7196d38b9f525a3a8f3428de7e23a23

fix airtap commands

view details

Feross Aboukhadijeh

commit sha de1842828ad438364beb8b4455fc06531387f0f9

0.118.0

view details

Feross Aboukhadijeh

commit sha 4d17509586485a64ee39ef838d80bfabece1e850

build

view details

Feross Aboukhadijeh

commit sha b9174f8f64a203a9ad258a6b5acb235660cb2048

Create dependabot.yml

view details

Feross Aboukhadijeh

commit sha ff05b3f45643ce8ad06768ea899bfb49d25b458b

Merge pull request #2032 from webtorrent/dep Create dependabot.yml

view details

dependabot[bot]

commit sha 7619768091fc3431f691b364874be86b738e7f34

Update mime requirement from ^2.5.0 to ^2.5.2 Updates the requirements on [mime](https://github.com/broofa/mime) to permit the latest version. - [Release notes](https://github.com/broofa/mime/releases) - [Changelog](https://github.com/broofa/mime/blob/master/CHANGELOG.md) - [Commits](https://github.com/broofa/mime/compare/v2.5.0...v2.5.2) Signed-off-by: dependabot[bot] <support@github.com>

view details

dependabot[bot]

commit sha 1fc73a2fac2e0bfcea09195c98a36c99561f25c2

Update queue-microtask requirement from ^1.2.2 to ^1.2.3 Updates the requirements on [queue-microtask](https://github.com/feross/queue-microtask) to permit the latest version. - [Release notes](https://github.com/feross/queue-microtask/releases) - [Commits](https://github.com/feross/queue-microtask/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support@github.com>

view details

dependabot[bot]

commit sha 8ebb67db181ec06aa9539a099dea4e0abbd21203

Update torrent-piece requirement from ^2.0.0 to ^2.0.1 Updates the requirements on [torrent-piece](https://github.com/webtorrent/torrent-piece) to permit the latest version. - [Release notes](https://github.com/webtorrent/torrent-piece/releases) - [Commits](https://github.com/webtorrent/torrent-piece/compare/v2.0.0...v2.0.1) Signed-off-by: dependabot[bot] <support@github.com>

view details

Alex

commit sha e0897ca34330f306b098e2f0eb1f192952335c99

Merge pull request #2033 from webtorrent/dependabot/npm_and_yarn/mime-tw-2.5.2 Update mime requirement from ^2.5.0 to ^2.5.2

view details

dependabot[bot]

commit sha f430dcc930d10212c88ca2aacdbd4810a25ab1d7

Update simple-peer requirement from ^9.9.3 to ^9.11.0 Updates the requirements on [simple-peer](https://github.com/feross/simple-peer) to permit the latest version. - [Release notes](https://github.com/feross/simple-peer/releases) - [Commits](https://github.com/feross/simple-peer/compare/v9.9.3...v9.11.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

Diego Rodríguez Baquero

commit sha bcb9f22b2e3d9297e30e1cc77feb2bd503148ce0

Merge pull request #2036 from webtorrent/dependabot/npm_and_yarn/simple-peer-tw-9.11.0 Update simple-peer requirement from ^9.9.3 to ^9.11.0

view details

Diego Rodríguez Baquero

commit sha 85e9c5ab9e87098652c46b438453ea8eab2ba9db

Merge pull request #2034 from webtorrent/dependabot/npm_and_yarn/queue-microtask-tw-1.2.3 Update queue-microtask requirement from ^1.2.2 to ^1.2.3

view details

push time in 2 months

PR opened webtorrent/webtorrent

fix: call public FileStream.destroy method so cb is defined

<!-- DO NOT POST LINKS OR REFERENCES TO COPYRIGHTED CONTENT IN YOUR ISSUE. -->

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [x] Bug fix [ ] New feature [ ] Other, please explain:

What changes did you make? (Give an overview) Previously, early exits in FileStream._notify would throw since cb was not defined in _destroy

Which issue (if any) does this pull request address?

Is there anything you'd like reviewers to focus on?

+2 -2

0 comment

1 changed file

pr created time in 2 months

create barnchjhiesey/webtorrent

branch : fix-stream-destroy-exception

created branch time in 2 months