Conversation
|
@code3ks is attempting to deploy a commit to the truthixify's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@code3ks 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! 🚀 |
|
This branch includes the idempotency implementation and unrelated wallet and UI changes. Please rebase and keep only the shared message protocol plus the app and worker integrations required by #189. |
f250fcf to
1fc64a1
Compare
…nd web worker - Add validateBroadcastChannelMessage + createMessage to StellarWalletContext - Add createMessage to useStellarNotifications for all SW postMessage calls - Add validateServiceWorkerInboundMessage + sendResponse helper to app-sw.ts - Add validateServiceWorkerInboundMessage + sendResponse helper to stellar-notification-sw.ts - Add validateWebWorkerMessage to stellar-scanner.worker.ts - Fix ScanStrategy type conflict (string union vs interface) Resolves wraith-protocol#189
1fc64a1 to
e2372b0
Compare
|
RECOVER_SCAN_CURSOR is missing from the union and valid types, so the validator now rejects that existing flow before its handler runs. Include all existing messages, reject missing versions, validate payload types, and add protocol tests. |
…ads, add tests - Add RecoverScanCursorMessage (publicKey, oldestAvailableLedger) to ServiceWorkerInboundMessage union - Add StellarScanRetentionGapMessage and StellarScanRecoveryCompleteMessage to ServiceWorkerOutboundMessage union - isVersionCompatible: reject missing version — no more silent fallback - validateServiceWorkerInboundMessage: RECOVER_SCAN_CURSOR added to validTypes; all payload fields now type-checked (string publicKey, positive-integer ledger, object subscription, etc.) - validateServiceWorkerOutboundMessage: add new broadcast types and tighten error-field checks - app-sw.ts / stellar-notification-sw.ts: remove all 'message as any' casts; destructure per handler from the typed message; add explicit SKIP_WAITING guard before RECOVER_SCAN_CURSOR - src/types/messages.test.ts: 49 tests — every validator, all valid paths, missing-version rejection, unknown-type rejection, per-field payload checks
|
The missing version and cursor cases are fixed. Payload validation is still presence-only in several paths: encrypted keys are not checked as |
Changes
New File
Updated Files
Service Workers
Web Worker
React Hooks
Context
Features
✅ Versioned TypeScript message unions - All 21 message types defined with version field
✅ Runtime validation - All message receivers validate incoming messages
✅ Reject unknown versions - Major version must match, descriptive error messages
✅ Shared protocol - Single source of truth in src/types/messages.ts
✅ Backward compatibility - Legacy messages without version accepted with warnings
Message Types Implemented
Testing
Done When (from issue #189)
closes #189