Repository navigation
Keep original LISTEN unsubscribe handles valid across reconnects - #1244
Open
CheckPickerUpper wants to merge 1 commit into
Open
CheckPickerUpper wants to merge 1 commit into
CheckPickerUpper wants to merge 1 commit into
Conversation
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.
After a LISTEN connection reconnects, the original
unlisten()handle resolves successfully while leaving its replacement callback registered. Preserve the listener object issued by the public call and reuse it during native reconnect. Check current membership before invokingonlisten, so a handle closed while registration is pending cannot announce that subscription ready.The existing native runner now covers original unsubscribe after reconnect with two listeners on the same channel, release of the last server LISTEN registration while ordinary queries remain available, and unsubscribe before a pending reconnect readiness callback. User callbacks provide positive observation barriers. The normal test entrypoint registers both scenarios through
tests/listen-reconnect.js; each retains the runner's existing five-second deadline.Validation:
1a2a1b2b1c2c:1:1instead of1a2a1b2b2c:1:0).first:2instead offirst:1).7a73d57d22c4227f3c970ff47ef57bdd63e6f394: both native ESM regressions passed (31.32s command), and the generated CJS pair passed (30.93s). Each run used a fresh real PostgreSQL17 fixture and the existing native runner with unchanged five-second scenario deadlines.npm run buildpassed for CJS, Deno, and Cloudflare generators (15.43s). Generated snapshots were retained locally for proof; this PR follows the current upstream source-only commit convention.Current-head workflow 37265016528 is awaiting maintainer approval and has not started any jobs. CI has not been claimed green.
Closes #1243