Skip to content

Keep atomized reference in _updateSnapshotStorage - #910

Merged
lejeunerenard merged 1 commit into
holepunchto:mainfrom
peerloomllc:fix/snapshot-atomized-null
Oct 28, 2026
Merged

lejeunerenard merged 1 commit into
holepunchto:mainfrom
peerloomllc:fix/snapshot-atomized-null

Conversation

@peerloomllc

Copy link
Copy Markdown
Contributor

Fixes #892.

SessionState.close() sets parent.atomized = null, so closing an atomic session while a snapshot of its parent waits in _updateSnapshotStorage throws TypeError: Cannot read properties of null (reading 'flushing') on the next loop check. Holding this.atomized in a local fixes it.

Adds a regression test in test/atomic.js built from the repro in the issue. It crashes without the change; the full suite passes with it (445/445).

@peerloomllc
peerloomllc requested a review from a team October 28, 2026 13:38

@lejeunerenard lejeunerenard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great! Nice and simple fix and the scenario makes sense now. Thank you for the repo before and the PR!

@lejeunerenard
lejeunerenard merged commit 122169f into holepunchto:main Oct 28, 2026
5 checks passed
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.

SessionState._updateSnapshotStorage throws when atomized is cleared during flush wait

2 participants