[BTAPI-82] Remove the wealthsimple-api migration feature flag #96

Merged
chris merged 13 commits from feature/BTAPI-82 into main 2026-10-02 09:46:21 -06:00
Owner

Ticket

BTAPI-82 Remove the wealthsimple-api migration feature flag

Summary

  • Deleted the WS_API_ENABLED / Config.wealthsimpleApiEnabled migration flag and collapsed every dispatcher it gated (activity fetch, doorbell forward, /sync/status) onto the single wealthsimple-api path.
  • Deleted the direct Wealthsimple GraphQL client (client/, queries.ts), credit-card account discovery, the balance read, and their now-orphaned fixtures. assertWealthsimpleApiClientConfig() is now unconditional at boot.
  • The sync no longer depends on the local Wealthsimple session. The getSessionHaltReason() gate in tick() was deleted outright, not just made conditional. Production bug it fixes: the local session died on 2026-09-28 and every sync was skipped as "dead" while wealthsimple-api was healthy.
  • /sync/status is sourced solely from wealthsimple-api. The 503 / session: 'unreachable' contract is now live, so the app's banner (BTAPP-53) must handle it. lastResult/lastError describe wealthsimple-api's job only; a stale local halted is no longer surfaced.
  • A malformed purchase in the feed now throws WealthsimpleApiClientError (ordinary failure streak, no cooldown).
  • ws:activities no longer prints a balance line.
  • A leftover WS_API_ENABLED=true in the deployed .env is ignored and can be deleted.
  • Tests: flag-off suites removed; regression guards added (dead local session must not affect the sync or the status) and the amount-validation tests ported onto the feed path. CLAUDE.md and comments updated to describe the single design.

Left for BTAPI-78

auth/, discovery/, totp/, request/, login-cli/, lib/data/wealthsimple-session, the SessionDeadError handling, the now-dormant 401/429 cooldown path in the sync engine, the GraphqlError plumbing in errors.ts, and WS_EMAIL / WS_PASSWORD / WS_TOTP_SECRET.

Manual checks still to run

  • Activity sync end to end against a healthy wealthsimple-api
  • Doorbell ring (POST /sync/wealthsimple)
  • GET /sync/status
  • bun --cwd=./server run ws:activities

🤖 Generated with Claude Code

https://claude.ai/code/session_018AmPhidGQpqS7QgKUdeZ7U

## Ticket [BTAPI-82](http://192.168.2.100:7123/home/browse/BTAPI-82/) Remove the wealthsimple-api migration feature flag ## Summary - Deleted the `WS_API_ENABLED` / `Config.wealthsimpleApiEnabled` migration flag and collapsed every dispatcher it gated (activity fetch, doorbell forward, `/sync/status`) onto the single wealthsimple-api path. - Deleted the direct Wealthsimple GraphQL client (`client/`, `queries.ts`), credit-card account discovery, the balance read, and their now-orphaned fixtures. `assertWealthsimpleApiClientConfig()` is now unconditional at boot. - **The sync no longer depends on the local Wealthsimple session.** The `getSessionHaltReason()` gate in `tick()` was deleted outright, not just made conditional. Production bug it fixes: the local session died on 2026-09-28 and every sync was skipped as "dead" while wealthsimple-api was healthy. - `/sync/status` is sourced solely from wealthsimple-api. The 503 / `session: 'unreachable'` contract is now live, so the app's banner (BTAPP-53) must handle it. `lastResult`/`lastError` describe wealthsimple-api's job only; a stale local `halted` is no longer surfaced. - A malformed purchase in the feed now throws `WealthsimpleApiClientError` (ordinary failure streak, no cooldown). - `ws:activities` no longer prints a balance line. - A leftover `WS_API_ENABLED=true` in the deployed `.env` is ignored and can be deleted. - Tests: flag-off suites removed; regression guards added (dead local session must not affect the sync or the status) and the amount-validation tests ported onto the feed path. CLAUDE.md and comments updated to describe the single design. ### Left for BTAPI-78 `auth/`, `discovery/`, `totp/`, `request/`, `login-cli/`, `lib/data/wealthsimple-session`, the `SessionDeadError` handling, the now-dormant 401/429 cooldown path in the sync engine, the `GraphqlError` plumbing in `errors.ts`, and `WS_EMAIL` / `WS_PASSWORD` / `WS_TOTP_SECRET`. ### Manual checks still to run - Activity sync end to end against a healthy wealthsimple-api - Doorbell ring (`POST /sync/wealthsimple`) - `GET /sync/status` - `bun --cwd=./server run ws:activities` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018AmPhidGQpqS7QgKUdeZ7U
chris merged commit 4f06a01b8e into main 2026-10-02 09:46:21 -06:00
chris deleted branch feature/BTAPI-82 2026-10-02 09:46:21 -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!96
No description provided.