Repository navigation
Ignore failures from a connection the store has moved off of - #2
Merged
Merged
Conversation
…the store A write still in flight on a superseded surface (such as the in-memory fallback, after retrySqliteStores binds the store back onto its file) resumes on a connection nothing reads from, and since nitro addresses a handle by name, may resume on the connection that replaced it, where none of its TEMP tables exist. Its guard used to report that as a statement error (SLEEPER-PROD-84T1) and, for a write, unbind the live store (SLEEPER-PROD-84GX). Both are now ignored once the surface is no longer the running one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5R4szy5V6TVSutrikAztt
Co-authored-by: Cursor <cursoragent@cursor.com>
sleeper-luke
marked this pull request as ready for review
October 14, 2026 16:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested via Slack thread
Before: When a store falls back to its in-memory database, the fallback reopens the in-memory database under the same name. A write still in flight from before the fallback then lands on the new, empty database, which has none of its
TEMPtables, and fails. That failure is treated as the live store's own, so it unbinds the healthy store, which reads empty until the next retry.After: A failure on a surface the store has already moved off of no longer moves the store or reports. The live store stays bound.
How:
buildGuardedremembers the surface it built, and its failure, contention and statement-error handlers check that this surface is still the running one before acting.onSqliteFailuremakes the same check, and again inside its deferred microtask in case the store moves in between. Newsrc/tests/superseded_connection.test.tshas 3 cases: 2 fail without the change and pass with it, and the third confirms that a failure on the running in-memory connection still unbinds the store.Tests:
superseded_connection.test.tsanddefine_sqlite_store.test.tspass under bothjestandjest.config.prod.js.🤖 Generated with Claude Code
https://claude.ai/code/session_01J5R4szy5V6TVSutrikAztt