mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
* feat(settings): profile-scoped danger zone actions and filtered household exports - Add target profile selection to Settings Danger Zone with full UX validation - Restrict default profile deletion and single remaining profile deletion - Filter data exports dynamically by active selected household profile IDs - Implement correct CSV format exports for categories, budgets, accounts, loans, and recurring - Reorganize Settings tabs: move exports into Household card, Danger Zone to General tab - Configure Cloudflare PR preview deployments with automatic PR comment links - Resolve parallel E2E database mutations and flaky test race conditions * fix(settings): make Danger Zone profile targeting re-entrancy-safe The profile-scoped Danger Zone actions carried the target profile in a shared mutable field on the singleton adapter (_profileIdOverride), set from the X-Profile-Id header and cleared in an unconditional finally. The destructive handlers resolve the profile only AFTER `await getDB()`, so any concurrent request (e.g. a background list refresh, which also carries a profile header) overwrote/cleared the override mid-flight — a delete targeting a non-active profile could fall back to and wipe the ACTIVE profile instead. Remove the shared override and resolve the target per-request from the headers inside each handler (targetProfileIdsFromHeaders), mirroring how export already worked, so concurrent requests can never clobber one another's target. - idb: drop _profileIdOverride + set/clear; deleteAllTransactions(pids?) takes an explicit target. - handlers: deleteAllTransactions / deleteAllCategories / profileResetData resolve the target from the request header (fallback: active profile, never "all"). - router: no per-request adapter state; pass headers to the destructive routes. - export: also accept X-Profile-Ids (JSON) so a multi-profile household export is not truncated to the first profile by backend/worker (which read that shape). - Settings: send X-Profile-Ids for households; add the profile name to export filenames (finance-export-<profile>-<date>.json, <type>-<profile>-<date>.<fmt>). Tests (dangerZone-profile-scoping): cross-profile isolation for delete-all- transactions / reset-categories / clear-profile-data, a concurrency regression that fails on the old shared-override code, and household export scoping. Full suite green; backend + worker paths are already request-scoped (no re-entrancy).
502 B
502 B
Deploying with Cloudflare Workers
The latest updates on your project.
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| Deployment successful! View logs |
finance-manager | COMMIT_SHA | Preview URL | UPDATED_TIME |