[BTAPP-58] Fix the Wealthsimple notification doorbell going silently stale #83

Merged
chris merged 4 commits from bug/BTAPP-58 into main 2026-08-30 15:10:25 -06:00
Owner

Ticket

BTAPP-58 Wealthsimple notification doorbell has stopped triggering syncs

Summary

  • Self-heal: useDoorbell now re-pushes this build's EXPO_PUBLIC_API_URL/API_KEY to native storage on every mount and app foreground while the toggle is on, not only on a manual flip — the actual root cause, since a dev-client JS reload could drift the native config with nothing to re-sync it.
  • Settings screen now shows the natively-configured host (never the key) and flags it when it disagrees with the current build's own API URL, replacing the previous boolean-only "configured" state.
  • Added a "Send test trigger" button that fires one real /sync/wealthsimple POST on demand and reports the actual HTTP status or error in the UI, so the doorbell's live config can be verified without waiting for a real Wealthsimple notification.

Notes for the reviewer

  • The Kotlin changes (Doorbell.kt, NotificationDoorbellModule.kt) are not covered by CI or automated tests, per this repo's existing convention (app/CLAUDE.md: "The Kotlin has no test coverage, and CI does not compile it").
  • Not fixed here (not a code change): app/.env on Chris's phone/dev machine uses EXPO_PUBLIC_API_URL=http://bravo:9999 (bare hostname) rather than the IP .env.example recommends. Worth a manual check that "bravo" resolves reliably from the phone on every network path — flagged in the ticket, out of scope for a PR since it's a gitignored local env file.
## Ticket [BTAPP-58](http://192.168.2.100:7123/home/browse/BTAPP-58/) Wealthsimple notification doorbell has stopped triggering syncs ## Summary - Self-heal: `useDoorbell` now re-pushes this build's `EXPO_PUBLIC_API_URL`/`API_KEY` to native storage on every mount and app foreground while the toggle is on, not only on a manual flip — the actual root cause, since a dev-client JS reload could drift the native config with nothing to re-sync it. - Settings screen now shows the natively-configured host (never the key) and flags it when it disagrees with the current build's own API URL, replacing the previous boolean-only "configured" state. - Added a "Send test trigger" button that fires one real `/sync/wealthsimple` POST on demand and reports the actual HTTP status or error in the UI, so the doorbell's live config can be verified without waiting for a real Wealthsimple notification. ## Notes for the reviewer - The Kotlin changes (`Doorbell.kt`, `NotificationDoorbellModule.kt`) are not covered by CI or automated tests, per this repo's existing convention (`app/CLAUDE.md`: "The Kotlin has no test coverage, and CI does not compile it"). - Not fixed here (not a code change): `app/.env` on Chris's phone/dev machine uses `EXPO_PUBLIC_API_URL=http://bravo:9999` (bare hostname) rather than the IP `.env.example` recommends. Worth a manual check that "bravo" resolves reliably from the phone on every network path — flagged in the ticket, out of scope for a PR since it's a gitignored local env file.
useDoorbell now re-pushes this build's EXPO_PUBLIC_API_URL/API_KEY into native
SharedPreferences on every mount and foreground while the toggle is enabled,
instead of only on a manual toggle flip. That's what let a dev-client JS reload
drift the stored config away from what the app was actually built with, with
nothing to notice or correct it.
getState() now reports the API host actually stored natively (never the key),
and useDoorbell exposes it alongside a configDrifted flag comparing it to this
build's own EXPO_PUBLIC_API_URL. The settings screen renders it as a
diagnostic line, flagging when the two disagree, so a stale native config is
visible instead of collapsing into the same "configured: true/false" boolean.
[BTAPP-58] Add a manual "Send test trigger" action.
Some checks failed
app / check (pull_request) Failing after 21s
02517cd303
Doorbell.kt gains sendTest(), firing one real POST /sync/wealthsimple against
native's stored config on demand (marker packageName "manual-test", no
debounce claim, no retry ladder, and it never touches lastTriggeredAt).
Exposed through NotificationDoorbellModule.sendTestTrigger() and a new
settings-screen button, so a broken or drifted native config can be diagnosed
without waiting for a real Wealthsimple notification to arrive.
[BTAPP-58] Fix pre-existing Prettier drift blocking CI.
All checks were successful
app / check (pull_request) Successful in 21s
plane-sync / sync (pull_request) Successful in 1s
59a62a5d15
app/lib/screens/transactions/.test.tsx picked up a stray trailing blank
line in BTAPP-53 (PR #81), which already broke app.yml on main before
this branch existed. Unrelated to this ticket, but it blocks this PR's
own CI, so fixing it here rather than waiting on a separate PR.
chris merged commit 1689447fd6 into main 2026-08-30 15:10:25 -06:00
chris deleted branch bug/BTAPP-58 2026-08-30 15:10:25 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/budget-tracker!83
No description provided.