Repository navigation
feat: register with the deployed wake gateways - #1944
Conversation
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummarySets default wake gateways by network:
No actionable issues found. coreyphillips explicitly deferred the swap and Paykit handlers and disclosed that the production device test remains pending. Reviews (1) · Last reviewed commit: "feat: register with the deployed wake ga..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Points Env.wakeGatewayUrl at https://wake.bitkit.to on mainnet and https://wake.staging.bitkit.to on regtest, keeps testnet and signet off, and keeps the debug WAKE_GATEWAY_URL override first. Reviewed ebd143e, light tier. Not built: on bitkit-android a review never runs the branch's Gradle build; reasoned from the code and CI.
What I checked, and 3 candidates I ruled out
Read in full: Env.kt (wake section), WakeConfig.kt, FcmService.kt; traced gatewayUrl through WakeRepo, WakeInbox, WakeHandlers, DevSettingsViewModel
Tests: WakeGatewayUrlTest.kt covers the per-network mapping
CI: build-and-test, compose-ui and the e2e shards on this head were still running when I read them; lint, detekt and Greptile green
Ruled out
- E2E builds on regtest now leave dead tokens on the staging gateway:
WakeConfig.isRegistrationEnabledis!Env.isE2eTest, andWakeReporeturnsWakeSync.Offon it before any register or opt-out call. - JVM unit tests now get a live gateway URL from
Env:WakeRepoTestandWakeInboxTeststubwakeConfig.gatewayUrl;WakeConfigTestdoes not read it; nothing inapp/src/testcalls the gateway throughEnv. - Upgraded mainnet installs register without consent: registration still goes through
isWakeOptedIn(Background Payments on and notification permission granted).
Merge confidence: 4/5, no findings, but the mainnet path has no device run against the prod gateway yet (the PR's own Gaps) and CI was still running.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to the reviewer does not carry it)
There was a problem hiding this comment.
This PR is a URL change, but it turns the whole wake registration path on by default: every mainnet and regtest install that WakeConfig counts as opted in now registers with the gateway. I reviewed it as the launch of that feature. One LOW is inline; it anchors on the URL line because the code it points at is unchanged here.
Not a finding: the opt-in gate counts notifications being on as consent, and below API 33 they are on by default. Registering that way links nothing new. Since #1932, public payments are always on while a profile exists, so the published invoices already tie the node id to the Pubky key. A wallet without a profile registers ln: only.
Checked and clean:
- Push payloads.
FcmServiceenqueuesWakeWorkerfor every data message. Without credentials it ignores them. Otherwise the payload must decrypt to the install's key, and onlywake.testhas a handler, which posts a notification with no intent extras. No payload field reaches a payment, a node start or persisted state beyond the 200-entry dedupe list. - Registration signatures. They are domain-separated (
wake-register-v1), so a gateway-chosen audience can't produce a reusable signature. The device secret goes out only as SHA-256. - Wipe. It unregisters before the keychain wipe, and
getNodeId()is null once the node stops, so nothing re-registers mid-wipe. - E2E builds never register (
WakeConfig.kt:28). - Startup. Nothing blocks it; all wake work runs in
appScopewith 10 s / 15 s timeouts. - iOS twin. synonymdev/bitkit-ios#1349 uses the same URLs. Its
WakeManager.swift:230has the same skip as the LOW; I haven't reproduced it there.
The PR body still says "Draft until a device test against staging and prod passes", and its Gaps list prod as unverified.
perf: relevant, because it adds default background work: one presence PUT per foreground minute (a new TLS connection each time), one DELETE per backgrounding, and registration once per fingerprint change.
Device gate (partial): ebd143e — not run yet; pending: presence and registration request rate against wake.staging.bitkit.to over 10 foreground minutes and one backgrounding, and cold start → Home, on this PR and master.
Skipped — covered by CI at ebd143e: unit tests, compose UI tests, detekt, lint, e2e (all green).
|
Triage: this PR goes in the 3.2.0 milestone under #1956, so 3.2.0 receives wakes through the deployed gateways. Twin: synonymdev/bitkit-ios#1349. |
No HIGH/MEDIUM left at ebd143e; the remaining LOW does not block. Device gate pending.
jvsena42
left a comment
There was a problem hiding this comment.
Approving: nothing above LOW from the code scan or the device gate. The approval stands with 1 LOW open: re-registering before the gateway retires an idle device. Fix it here or in a follow-up issue, whichever you prefer, and reply on the thread saying which.
On the device the PR build behaves as described.
- Registration. It registered once after the first node start (
Registered(deviceId=…, unknownTopics=[])), and six later cold starts loggedUpToDate. - Presence. Foreground presence renewed every ~61 s, 10
PUTs in 10 minutes with no failures or retries. In the background it renewed nothing. - Manual test 1. Dev Settings shows
https://wake.staging.bitkit.to, and the gateway's Device view lists theln:identity with topicspaykit.*, swap.*. - Manual test 2. Send Test Wake works over real FCM. The push arrived in ~4 s, the "Wake test" notification was posted, and the push was acked
HANDLED. - Master. It shows the gateway off and refuses Test Wake.
I couldn't count the DELETE on backgrounding: clearPresence logs nothing on success, and the emulator packet capture saw no gateway traffic. No Failed to clear wake presence was logged.
Device gate: ebd143e — Pixel_9 emulator (API 37), CI APKs (PR ebd143e, master f9a473aae), staging wake gateway with real FCM. Manual tests 1 and 2 pass. perf: cold start median 2.1 s to activity, 6.0 s to Home with balance (master 1.9 s / 5.7 s; the slow outliers on both builds came from emulator-wide stalls); 1.0 presence req/min in the foreground (master 0), 0 in the background, 1 registration per fingerprint; no ANR or OOM. Figma: n/a. l10n: no UI text changed.
DELETE /v1/presence count (no success log, no packet capture), and prod (wake.bitkit.to), which needs a mainnet build with the bitkit-prod Firebase config.
Skipped — covered by CI at ebd143e: unit tests, compose UI tests, detekt, lint, e2e (all green).
Closes #1956
Part of #1804
Twin: synonymdev/bitkit-ios#1349
Points builds at the deployed wake gateways (synonymdev/wake#2). Draft until a device test against staging and prod passes.
Description
Env.wakeGatewayUrl: mainnet useshttps://wake.bitkit.to, regtesthttps://wake.staging.bitkit.to, and testnet and signet stay off. The debugWAKE_GATEWAY_URLoverride still wins.Out of Scope
swap.claimableandpaykit.synchandlers (Phase 2 and 3): until then those wakes ackno_handler.Design
N/A: no UI changes.
Preview
N/A
QA Notes
Setup
A debug build (regtest) on a device, without
WAKE_GATEWAY_URL, with thebitkit-staggoogle-services.jsonand Background Payments on.Journeys
N/A: not drivable; see Manual Tests.
Manual Tests
https://wake.staging.bitkit.toAutomated Checks
WakeGatewayUrlTest.kt: each network maps to its gatewayEvidence
ebd143e: build, unit tests, lint, detekt and UI tests passed. Its regtest APK uses Firebase projectbitkit-stag.Gaps
bitkit-prodFirebase config.