Repository navigation
feat: support strict notification subprotocol authentication - #266
Merged
Merged
Conversation
argilzar
marked this pull request as ready for review
November 2, 2026 16:34
Ramattra reviewSummary: No blocking issues found. The strict-mode credential handling and the lifecycle fixes are correct, and the regression coverage is strong. What I verified
Notes (non-blocking)
Automated review by Ramattra — comments only, a human decides on merge. |
langastina
approved these changes
Nov 3, 2026
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.
Add opt-in
NotificationClientOptions.allowQueryFallback: falsefor consumers that must never retry API keys or bearer tokens in request URLs. Existing clients retain the default compatibility fallback.Strict mode requires negotiation of the offered authentication scheme before sending a subscription. Initial handshake errors, closes before opening, and missing/wrong scheme negotiation report a fixed observer error without starting query fallback. The SDK option must subsequently be forwarded by wrappers such as data-pump; this PR alone does not enable it in clustered push.
Review also reproduced two existing lifecycle defects now corrected here: reconnect scheduling previously kept the connect guard set, and disconnect did not invalidate asynchronous setup. Reconnect now releases the guard; generation checks prevent canceled setup and stale socket callbacks from opening or subscribing, and disconnect clears reconnect timers. In-flight HTTP/token requests are not aborted. Added regressions cover accepted/rejected replacement handshakes and cancellation during metadata fetch, socket negotiation, and reconnect backoff. The expanded fixture fails against the previous PR head and passes with these fixes.
Final quality review also found error→abnormal-close could reconnect after observer termination. The corrected terminal-error path invalidates the socket generation, clears pending retry state and reports the error once; subsequent close cannot resubscribe. Regression covers strict and compatibility modes, RED at the preceding head and GREEN at the current head. Close-only abnormal disconnects still reconnect.
Validation: the isolated transport regression fails against unchanged SDK source and passes with this change. It covers API-key and bearer success/failure paths and default fallback compatibility. Full suite: 249 pass; typecheck, lint, ESM/CJS/declaration builds and diff check pass on Bun 1.4.2. Network boundaries use synthetic fixtures; no live credentials or subscriptions.
Limits: no general logging-safety claim, no sanitization of caller-supplied endpoint URLs, no deployment or consumer activation. Draft pending independent review. Usable discovery tools were unavailable; scope follows the previously read native HTTP programme and verified SDK source.