Repository navigation
Conversation
…cleanup Adds 28 deterministic tests for the real useSSE transport, driven against a fake SSE server that rejects reads with AbortError on abort like fetch does: - connection and authorization: Accept header, bearer token, reconnect on token / url change, null url - delivery: multi-frame chunks, frames split across chunks, comment and non-data lines, latest onMessage without reconnecting - malformed events: unparsable frames are logged and skipped, the stream stays up and later frames are delivered - backoff: non-OK / null body / network / non-Error failures, 1s then 2s delays, three-attempt cap, backoff reset after a successful open - fallback polling: default and custom intervals, never without a handler - cleanup: unmount aborts the stream and clears pending timers and polling The new file is added to the scoped frontend regression step in ci.yml so it runs in CI. Closes LabsCrypt#2136
Malware detection scan flagged this pull requestThe scan found 2 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.
This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional. |
This branch has not been deployed
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.
Closes #2136
Adds 28 deterministic tests for the real useSSE transport, driven against a fake SSE server that rejects pending reads with AbortError on abort, like fetch does.
Covered:
The new file is added to the scoped frontend regression step in ci.yml, so it runs in CI.
Behaviour pinned (worth a look): every successful open resets the attempt counter, so a server that opens and then closes cleanly never triggers fallback polling. Not asserted: after three failures with no onFallbackPoll handler the status stays "connecting" rather than "disconnected".
Verification: CI's exact scoped command (jest ... --runInBand) passes, 100 tests; prettier clean on the new file. tsc reports 2 pre-existing errors in src/components/PWAComponents.tsx, identical on main.
Note: submitted after the Oct 22 due date; please let me know if it can still count.