Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocksdb: SessionState.moveTo API #609

Merged
merged 27 commits into from
Dec 13, 2024
Merged

rocksdb: SessionState.moveTo API #609

merged 27 commits into from
Dec 13, 2024

Conversation

chm-diederichs
Copy link
Contributor

No description provided.

@chm-diederichs chm-diederichs changed the base branch from main to rocksdb November 29, 2024 17:39
index.js Outdated
@@ -326,6 +328,7 @@ class Hypercore extends EventEmitter {
}

this.state.addSession(this)
this._sessionOpen = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using this flag you can just check that stateIndex !== -1

index.js Outdated
@@ -299,7 +301,7 @@ class Hypercore extends EventEmitter {
}

if (opts.parent) {
if (opts.parent.state === null) await opts.parent.ready()
if (!opts.parent._sessionOpen) await opts.parent.ready()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment below but opts.parent._stateIndex === -1 should do the trick

@chm-diederichs chm-diederichs merged commit 8905a0e into rocksdb Dec 13, 2024
4 checks passed
@chm-diederichs chm-diederichs deleted the rocksdb-move-to branch December 13, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants