Repository navigation
fix(wake): close the client gaps from the gateway review - #195
Conversation
- A default registration ts is one past the last in this process, so two quick registrations no longer get 409 stale_registration. - GatewayRejected carries server_time and retry_after_secs. - Add wake_get_device and wake_send_test. wake_set_topics returns unknown_topics.
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Closes the wake client gaps: monotonic default registration ts, server_time and retry_after_secs on GatewayRejected, wake_get_device, wake_send_test, and WakeSubscription with unknown_topics from wake_set_topics. Reviewed 78f2d64, full tier.
What I checked, and 5 candidates I ruled out
Read in full: the diff of src/lib.rs, src/modules/wake/{client,errors,registration,types}.rs, the new tests in tests.rs, the README section
Call sites traced: wake_prepare_registration (default and explicit timestamp), rejection for every parser, send for the Retry-After header, parse_wake_id for the test wake id
CI: wake-tests, paykit-route-tests, SwiftPM and manifest checks green; iOS and Android bindgen still running at review time
Not built here: my sandboxed runner could not confirm the author's permission and refused to run the branch, so the tests count is CI's, not mine
Ruled out
- Explicit
timestampskipsLAST_TIMESTAMP: a caller retrying withserver_timeafterstale_timestamphas a clock more than 600 s off, so a later default from that clock is refused as stale anyway; it cannot collide into a 409. - Default
tsrunning ahead of the clock: it moves one second per registration in the same second, so it needs hundreds of registrations in a burst to leave the 600 s window. unknown_topicsrequired inSetTopicsResponse:RegisterResponsealready requires it, and the module is documented as experimental until the apps adopt it.- Strict
platform/environmentdecode inparse_get_device: matches the two valuesWakePlatformandWakeEnvironmentserialise to, the same way the rest of the module rejects what it cannot place. - HTTP-date
Retry-After: deliberately mapped toNone, and the executor test covers both forms.
Merge confidence: 4/5, the bindgen jobs had not finished and the tests were not run here.
There was a problem hiding this comment.
Verdict: ✅ Approve
Findings: None.
QA for 78f2d64:
The videos record terminal output from automated assertions against the library built at this head.
Wake validation and HTTP responses ✅ The wake unit tests pass, including timestamp ordering, new device routes and retry metadata.
Checked with cargo test --locked --lib modules::wake; the recording shows the same test executable running the non-live cases.
wake-unit.2x.mp4
Register and update a device through the gateway ✅ The live device round trip passes immediate re-registration, device lookup, test-wake queueing and topic updates.
live_gateway_round_trip also checks unknown-topic reporting, presence and secret revocation on unregister.
gateway-device.2x.mp4
Deliver and revoke a peer wake grant ✅ The live grant round trip receives, decrypts and acknowledges a fake-provider push, then rejects the revoked grant.
Checked with live_gateway_grant_round_trip, including grant restrictions and usage counters.
gateway-grant.2x.mp4
Call the wake API through Swift bindings ✅ The checked-in Swift bindings compile and pass live calls through the exported Rust API.
A standalone Swift async caller checks re-registration, WakeDevice, WakeSubscription, optional presence, serverTime on a stale registration and retryAfterSecs after exhausting the test-wake allowance.
swift-bindings.2x.mp4
No device run: this experimental wake API has no app caller yet. Real APNs/FCM delivery and Android-side invocation remain untested.
Full review of the diff, 10 files. Also read the existing code review; the QA above was run independently.
Reviewed by gpt-6.1-sol-high
Closes the client gaps found in the wake gateway's pre-prod review.
tsis one past the last in this process, so two quick registrations (launch plus token callback) no longer get409 stale_registration.GatewayRejectedgainsserver_time(401stale_timestamp) andretry_after_secs(429).wake_get_deviceandwake_send_test.wake_set_topicsreturnsWakeSubscriptionwithunknown_topics.Breaking for the wake API, which no app uses yet. iOS bindings regenerated.
Tests:
cargo test --lib modules::wakepasses, and both live tests pass against the wake docker stack.