Repository navigation
fix: stop overlapping background notary proofs - #421
Merged
Merged
Conversation
- Share one pingTradeStatus run between the alarm, service worker wake-up, and page bridge - Run one notary proof at a time so closing the offscreen document can't kill another proof - Share the offscreen creation promise so callers wait for its message listener - Use wss:// for the notary session socket, older Chrome rejects https:// - Skip background proving when the offscreen WORKERS reason is unsupported
GODrums
approved these changes
Oct 17, 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.
Summary
wss://for the notary session WebSocketWORKERSreasonRef CSF-2167
Note
Medium Risk
Changes concurrency and offscreen/notary session wiring for trade status and TLSN proofs; incorrect deduplication or readiness timing could miss updates or break proving on some browsers.
Overview
Prevents duplicate background work when alarms, service worker wake-ups, or other triggers overlap.
pingTradeStatusnow deduplicates concurrent calls without a Steam ID into a single in-flight run, while calls that passexpectedSteamID(page bridge) still run independently so user-specific fetches are not skipped.Notary proving is limited to one concurrent proof (down from two) because the offscreen document can close after a proof and abort other in-flight work. Background notary is disabled on Firefox and on Chrome builds missing
chrome.offscreen.Reason.WORKERS.Offscreen lifecycle:
openOffscreenDocumentuses a shared creation promise so parallel openers always wait for theoffscreen_readymessage before proceeding. The notary session client builds WebSocket URLs viatoWebSocketUrl(wss://) for older Chrome that rejectshttp(s)inWebSocket.Adds a unit test asserting shared vs independent
pingTradeStatusbehavior.Reviewed by Cursor Bugbot for commit b0a15a4. Bugbot is set up for automated code reviews on this repo. Configure here.