Skip to content

Commit

Permalink
fix: Fix for hypercore 10.6.0 change to update() (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Jul 6, 2023
1 parent 9579359 commit 0152d4b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/core-index-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CoreIndexStream extends Readable {
this.#state = 'indexing'
this.emit('indexing')
this.#bitfield = await Bitfield.open(this.#storage)
await this.#core.update()
await this.#core.update({ wait: true })
this.#core.on('append', this[kHandleAppend])
this.#core.on('download', this[kHandleDownload])
}
Expand Down
2 changes: 1 addition & 1 deletion test/multi-core-indexer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ test('Appends from a replicated core are indexed', async (t) => {
for (const [i, core] of localCores.entries()) {
const remote = (remoteCores[i] = await create(core.key))
replicate(core, remoteCores[i], t)
await remote.update()
await remote.update({ wait: true })
await remote.download({ start: 0, end: remote.length }).downloaded()
}
/** @type {Entry[]} */
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests/core-index-stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ test('Appends from a replicated core are indexed', async (t) => {
const b = await create(a.key)

replicate(a, b, t)
await b.update()
await b.update({ wait: true })
const range1 = b.download({ start: 0, end: b.length })
await range1.downloaded()

Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests/multi-core-index-stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ test('Appends from a replicated core are indexed', async (t) => {
for (const [i, core] of localCores.entries()) {
const remote = (remoteCores[i] = await create(core.key))
replicate(core, remoteCores[i], t)
await remote.update()
await remote.update({ wait: true })
const range = remote.download({ start: 0, end: remote.length })
await range.downloaded()
indexStreams.push(new CoreIndexStream(core, ram()))
Expand Down

0 comments on commit 0152d4b

Please sign in to comment.