profile
viewpoint
Martín Acosta tinchoz49 @geut La Plata - Buenos Aires - Argentina https://geutstudio.com Fervent JS Developer with keen interesting in Rust. Co-founder of @laplatajs and @geut. Devoted Surfer.

RangerMauve/discovery-swarm-web 41

Abstracts away discovery-swarm interaction with WebRTC and a websocket gateway.

geut/caracara 32

GEUT LABS. An experimental Dat based collaborative editor.

random-access-storage/random-access-chrome-file 23

random-access-storage instance backed by the Chrome file system api

geut/olaf 22

A P2P chat using Dat.

geut/moleculer-browser 19

Moleculer for the browser.

tinchoz49/bacl 7

Simple, fast and secure node ACL

dxos/feed-store 6

A consistent store for your hypercore feeds.

geut/socket.io-streamify 3

Convert your socket.io sockets into duplex streams.

random-access-storage/random-access-test 3

Test suite for random-access-storage compatibility

dxos/network-generator 2

Simulate a network graph of connection streams.

startedmicromark/micromark-extension-mdx-expression

started time in 2 minutes

startedmicromark/micromark-extension-mdxjs-esm

started time in 2 minutes

created repositoryvweevers/is-git-branch-name-valid

Check that a git branch name is well formed.

created time in 32 minutes

startedleonardomso/33-js-concepts

started time in an hour

started30-seconds/30-seconds-of-code

started time in an hour

created repositoryvweevers/is-git-ref-name-valid

Check that a git reference name is well formed.

created time in 2 hours

startedthi-ng/synstack

started time in 3 hours

startedakveo/react-native-ui-kitten

started time in 6 hours

startedlarsgw/citation.js

started time in 6 hours

startedredibox/core

started time in 7 hours

startedk88hudson/git-flight-rules

started time in 9 hours

startedrsms/go-crdt-playground

started time in 10 hours

startedk88hudson/git-flight-rules

started time in 10 hours

startedkyokan/footnote

started time in 13 hours

startedhmeyer/tessellation

started time in 14 hours

startedbento-video/bento

started time in 16 hours

startednrwl/nx

started time in 16 hours

fork chrisguttandin/wpt

Test suites for Web platform specs — including WHATWG, W3C, and others

https://web-platform-tests.org/

fork in 19 hours

startedmafintosh/raxor

started time in 19 hours

startedunixpickle/gobfuscate

started time in 19 hours

PublicEvent

startedhyperdivision/nanoeth

started time in a day

startedalphacep/vosk-api

started time in a day

issue openedgeut/hypercore-promise

Difference in `download` method - rejected promise on close

I noticed a difference in behavior between hypercore and hypercore-promise:

const hypercore = require('@geut/hypercore-promise')
const ram = require('random-access-memory')
const feed = hypercore(ram)
feed.download({ start: 0, end: -1 })
feed.close()

produces:

(node:709947) UnhandledPromiseRejectionWarning: Error: Feed is closed
    at /home/bit/Code/node/sonar/node_modules/hypercore/index.js:1508:26
    at Request.done [as _callback] (/home/bit/Code/node/sonar/node_modules/hypercore/lib/storage.js:228:5)
    at Request.callback (/home/bit/Code/node/sonar/node_modules/random-access-storage/index.js:173:8)
    at nextTickCallback (/home/bit/Code/node/sonar/node_modules/random-access-storage/index.js:272:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)

The reason is that feed.download() in hypercore optionally takes a callback. The callback is called with an Error Feed is closed if the download request is still active when closing a feed. Because the callback is optional, this often is a noop. hypercore-promise appends a callback and returns a promise that would resolve when the download is complete, or is rejected when the feed is closed before the download is complete (which is always the case for infinite downloads).

What works now is to pass null as second argument to feed.download() on a promisified hypercore (original hypercore receives null for callback, thus not calling it with an error) if you don't want to await the result of the download.

I don't know of a clean solution right away. Maybe documenting is enough.

created time in a day

startedmafintosh/raxor

started time in a day

created repositorymafintosh/raxor

A seekable (random-access) XSALSA20 xor stream

created time in a day

startedfacebookresearch/wav2letter

started time in a day

created repositoryTylorS/snowpack-plugin-hash

Apply content hashes to your production build

created time in a day

startedantfu/vite-plugin-components

started time in a day

more