No description
  • TypeScript 75.7%
  • JavaScript 17.1%
  • Kotlin 3.5%
  • HTML 1.5%
  • Shell 1.2%
  • Other 1%
Find a file
Chris Harrington 4f06a01b8e
All checks were successful
server / check (push) Successful in 36s
[BTAPI-82] Remove the wealthsimple-api migration feature flag
## 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
Reviewed-on: #96
2026-10-02 09:46:20 -06:00
.claude Reduce token usage. Phase two. 2026-08-31 18:24:26 -06:00
.devcontainer [BTAPI-1] Replicate the irrigo Docker dev stack (#1) 2026-06-05 16:12:30 -06:00
.forgejo [BTAPI-80] Add alert-webhook receiver for wealthsimple-api dead-session alerts 2026-09-15 13:25:21 -06:00
.vscode [BTAPI-1] Replicate the irrigo Docker dev stack (#1) 2026-06-05 16:12:30 -06:00
app Revert negative background colour to pink 2026-09-16 12:41:05 -06:00
docs [BTAPI-82] Remove the wealthsimple-api migration feature flag 2026-10-02 09:46:20 -06:00
server [BTAPI-82] Remove the wealthsimple-api migration feature flag 2026-10-02 09:46:20 -06:00
.env.example [BTAPI-82] Remove the wealthsimple-api migration feature flag 2026-10-02 09:46:20 -06:00
.gitignore [HOMELAB-141] Move Mongo data from named volume to bind mount 2026-09-26 14:10:11 -06:00
.prettierrc feature/BTAPI-71 2026-08-29 11:41:57 -06:00
build-apk.sh [BTAPP-59] Add flag to build-apk.sh to build an APK with the settings view hidden 2026-09-02 18:05:02 -06:00
bun.lock feature/BTAPI-71 2026-08-29 11:41:57 -06:00
CLAUDE.md [BTAPI-82] Remove the wealthsimple-api migration feature flag 2026-10-02 09:46:20 -06:00
docker-compose.yml [BTAPI-82] Remove the wealthsimple-api migration feature flag 2026-10-02 09:46:20 -06:00
Dockerfile.dev [BTAPI-68] Present a real browser TLS and HTTP/2 fingerprint to Wealthsimple 2026-08-29 15:39:20 -06:00
Dockerfile.metro [BTAPI-1] Replicate the irrigo Docker dev stack (#1) 2026-06-05 16:12:30 -06:00
package.json feature/BTAPI-71 2026-08-29 11:41:57 -06:00
tsconfig.json feature/BTAPI-71 2026-08-29 11:41:57 -06:00