mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 21:46:49 +00:00
47a4276e84
logout() unregistered every sync trigger, and the only place that registers them is App's mount effect - which never runs again, because logout navigates through the router rather than reloading. Log out, log back in, go offline, edit something: it queues and nothing ever flushes it. No online listener, no visibilitychange, no 30s heartbeat, no WS reconnect hook. Register on auth success instead; registerSyncTriggers is already idempotent. The background sync loops only checked the auth gate on entry. Logout swaps the Dexie handle to the shared anonymous database, so a trip loop or a blob download still in flight afterwards wrote the logged-out account's itinerary and documents into it - the database that survives logout and greets the next person on a shared device. Check the gate per iteration. And the remote place:updated applier replaced the whole embedded place, while the local reducer right next to it preserves the assignment's own times. Same event, two answers, and the remote one wipes a scheduled 09:00-10:30 off the itinerary when someone else renames the place. One merge helper now, used by both, so they cannot drift again. The test that should have caught it seeded null times and asserted only the name. Also: moving a day note deleted before it created, and restored the note only locally when the create failed; t() interpolation was corrupted by a '$' in a parameter value; a 429 upload was treated as permanently failed; and the geolocation watch was started inside a state updater.
11 lines
522 B
TypeScript
11 lines
522 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
|
|
// Guards the lifecycle option in tests/setup.ts: a cross-origin call nobody mocked must
|
|
// fail here rather than actually leaving the runner (see msw/handlers/external.ts for the
|
|
// FX widget that once did, and answered after its test environment was gone).
|
|
describe('msw unhandled requests', () => {
|
|
it('FE-MSW-EGRESS-001: an unmocked cross-origin request is refused', async () => {
|
|
await expect(fetch('https://unmocked.example/rates')).rejects.toThrow();
|
|
});
|
|
});
|