From 6304703d67e61fd2acc47ccf829d15a9d3f1314e Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Tue, 18 Aug 2026 22:07:08 +0200 Subject: [PATCH] fix: clear recovered travel errors --- .../task-7-report.md | 28 +++++++++++++++++++ .../app/features/world/world.store.spec.ts | 2 ++ .../web/src/app/features/world/world.store.ts | 1 + 3 files changed, 31 insertions(+) diff --git a/.superpowers/sdd/2026-08-18-first-visible-vertical-slice/task-7-report.md b/.superpowers/sdd/2026-08-18-first-visible-vertical-slice/task-7-report.md index ef6fd75..372b9cc 100644 --- a/.superpowers/sdd/2026-08-18-first-visible-vertical-slice/task-7-report.md +++ b/.superpowers/sdd/2026-08-18-first-visible-vertical-slice/task-7-report.md @@ -59,6 +59,34 @@ git diff --check -- # exit 0 ``` +## Review fix round 2 + +The transient-poll regression now asserts both phases: the failed poll exposes +`Temporary failure`, and the successful authoritative `IDLE` retry clears it. +The new assertion was RED against the prior implementation because the error +remained set after the retry. `refreshCurrentTravel()` now clears the polling +error only after a successful API response and before applying that response; +the countdown contract and all other error paths are unchanged. + +Fresh verification: + +```powershell +npm test --workspace=@ashen-realms/web -- --watch=false --include='src/app/features/world/world.store.spec.ts' +# 1 test file passed, 9 tests passed + +npm test --workspace=@ashen-realms/web -- --watch=false +# 3 test files passed, 13 tests passed + +npm run build:web +# Angular production build completed successfully + +npm exec --workspace=@ashen-realms/web -- prettier --check +# All matched files use Prettier code style + +git diff --check -- +# exit 0 +``` + The web workspace declares neither a `lint` script nor an ESLint dependency, so there is no repository-configured lint command to run for this task. diff --git a/apps/web/src/app/features/world/world.store.spec.ts b/apps/web/src/app/features/world/world.store.spec.ts index 6ff1935..03b11a3 100644 --- a/apps/web/src/app/features/world/world.store.spec.ts +++ b/apps/web/src/app/features/world/world.store.spec.ts @@ -166,11 +166,13 @@ describe('WorldStore', () => { await vi.advanceTimersByTimeAsync(999); expect(api.getCurrentTravel).toHaveBeenCalledTimes(2); + expect(store.error()).toBe('Temporary failure'); await vi.advanceTimersByTimeAsync(1); expect(api.getCurrentTravel).toHaveBeenCalledTimes(3); expect(store.currentTravel()).toEqual({ status: 'IDLE' }); + expect(store.error()).toBeNull(); }); it('ignores a late poll response after the store is destroyed', async () => { diff --git a/apps/web/src/app/features/world/world.store.ts b/apps/web/src/app/features/world/world.store.ts index b6ec9d9..0d273ad 100644 --- a/apps/web/src/app/features/world/world.store.ts +++ b/apps/web/src/app/features/world/world.store.ts @@ -173,6 +173,7 @@ export class WorldStore implements OnDestroy { return; } + this.errorState.set(null); await this.setCurrentTravel(travel); if (travel.status === 'TRAVELLING') { this.scheduleTravelRetry();