Repository navigation
feat(sw): finish background scanning without spending authority (#212) - #237
Jerryvic911 wants to merge 5 commits into
Conversation
|
Someone is attempting to deploy a commit to the truthixify's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Jerryvic911 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
Blocking findings:
-
src/workers/stellarScanMatch.ts:33rejects every announcement whose scheme is notSCHEME_ID(v1 = 1), but this worker fetches from the configured v2 announcer insrc/sw/app-sw.ts:96; that contract only emits scheme 2. The SDK scanner already treatsSCHEME_ID_V2as supported. As written, background scans complete and advance the cursor while silently reporting zero matches for deployed v2 payments. Add a scheme-aware v2 matching path (including the v2 view-tag derivation) and a non-vacuous scheme-2 fixture. -
The claimed lock behavior is not connected to production.
lockScanKey/lockAllScanKeysare exported fromsrc/sw/scanKeyStore.ts:160-162, but no non-test code calls either function. Wallet/app lock or disconnect therefore leaves the IndexedDB wrapping key usable and the worker able to decrypt scan material. Wire key locking into the real lock/disconnect lifecycle and cover that lifecycle end-to-end, not only the backend helper. -
src/sw/announcementFetch.ts:66-69stops whenever a page contains fewer than 1,000 events even if RPC returned a continuation cursor. That can discard later pages and then advancelastScannedLedger, permanently skipping announcements. Also, a malformed/missingresult.eventsis treated as an empty successful page. Consume until the cursor is absent and validate the JSON-RPC result before allowing the scan cursor to advance; add short-page-with-cursor and malformed-envelope tests.
|
Thanks for the review. Status:
One question: |
truthixify
left a comment
There was a problem hiding this comment.
The prior pagination, lock-lifecycle, and scheme-2 findings are fixed, but src/sw/announcementFetch.ts:102-106 now treats a repeated continuation cursor as successful exhaustion. That returns a partial announcement list with latestLedger, and the caller can advance its durable scan cursor past unread events. A repeated non-empty cursor is a malformed/stalled RPC response and must fail without advancing; update the current "stops when the cursor stops advancing" test to assert rejection. The six focused suites (46 tests) and build otherwise pass locally.
…t ledger ends a scan (wraith-protocol#212)
truthixify
left a comment
There was a problem hiding this comment.
The stalled-cursor follow-up resolves the reliability blocker. Reviewed exact head 3c01c7b: all 49 focused background-scan tests pass and the production build succeeds. Approved, but the branch still conflicts with current develop and must be rebased before merge.
Summary
Finishes background scanning for #212 without exposing spending authority.
postMessagecarries only{ type, publicKey }.findMatchesthat needs no spending scalar (parity-tested againstscanWithStrategyfor fast/balanced/full). Notifications contain only the stealth address.encrypted*fields are scrubbed from old records on activate.Notes
app-sw(serviceWorker.ready). It previously registered/sw/stellar-notification-sw.js, which isn't built intodist.stellar-scanner.worker.tsstill receives the spending scalar from the page.Closes #212