hypercore-protocol / hypercore-next

Hypercore 10 is an append only log with multi-writer primitives built in.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hit this today

mafintosh opened this issue · comments

/home/ubuntu/hypermirror/node_modules/hypercore/lib/replicator.js:443
this.upgrading.resolve()
^

TypeError: Cannot read property 'resolve' of null
at RequestPool._onupgrade (/home/ubuntu/hypermirror/node_modules/hypercore/lib/replicator.js:443:20)
at async Replicator.ondata (/home/ubuntu/hypermirror/node_modules/hypercore/lib/replicator.js:805:7)

@mafintosh

this.upgrading is null unless one of two specific lines are run. There are lines 319 and 379.
319 is inside the function _updateUpgrade. I think the error might be in 379. The two lines above it have the comment:

// TODO: if the peer fails, we need to resolve the promise as well woop woop
// so we need some tracking mechanics for upgrades in general.

My guess is something went wrong with

  1. The UpgradeLock constructor. But I can't really think of a way a constructor so simple my run into an error and return null.
  2. The conditions to set this.upgrading, which are in lines 318 and 362-390 (a lot of TODO notes in that area).

Is there a way to replicate the error?