Skip to content

test(sessions): add regression test for rows surviving failed refresh - #47

Closed
iscekic wants to merge 1 commit into
mainfrom
kwf/surface-the-web-app-apps-web-0606
Closed

test(sessions): add regression test for rows surviving failed refresh#47
iscekic wants to merge 1 commit into
mainfrom
kwf/surface-the-web-app-apps-web-0606

Conversation

@iscekic

@iscekic iscekic commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Request

Surface: the web app (apps/web).

On the sessions page, a failed refresh replaces the visible rows with the empty state, so a transient network error looks like "no sessions". Reproduce first on the live web app: load the page with rows present, then fail the refresh request. If the rows already survive a failed refresh, stop with the evidence and no code change. If they do not, keep the rows, show an inline retry that works, and declare the list empty only after a query completes successfully. Prove the fix live with a recording or screenshots in the PR body.

Changelog for users

  • No user-visible change: the sessions list already keeps the visible rows when a refresh fails, so a transient network error does not replace them with the empty "No sessions yet." state.

Changelog for maintainers

  • Reproduced on the live app: with rows present, a failed refresh no longer clears the list; the empty state is not shown (see E2E proof).
  • No production code change was needed — TanStack Query retains the last successful list/search data on a failed refetch, and the render branch only shows the empty state after a query has data with zero rows.
  • Added a mounted regression test (apps/web/src/app/(app)/cloud/sessions/SessionsPageContent.test.ts) that renders the real component with real TanStack Query and asserts the rows stay rendered and neither the empty state nor the loading state appears after invalidateQueries rejects.
  • Review note: the new test uses a linkedom DOM, mocks the trpc plumbing and leaf UI components, and mirrors the app's query defaults (staleTime 60s, retry 1) from the providers.

E2E proof

Recording of the verified flow (waits trimmed)

e1-refresh.webm.trim.mp4

[e1] sessions failed refresh does not show empty state — e2e-web/e1-rows-present.png

[e1] sessions failed refresh does not show empty state — e2e-web/e1-refresh-failed.png

Follow-ups (not changed here)

  • sessions page — failed refresh has no error/retry .

Surface: the web app (apps/web).

On the sessions page, a failed refresh replaces the visible rows with the empty state, so a transient network error looks like "no sessions". Reproduce first on the live web app: load the page with rows present, then fail the refresh request. If the rows already survive a failed refresh, stop with the evidence and no code change. If they do not, keep the rows, show an inline retry that works, and declare the list empty only after a query completes successfully. Prove the fix live with a recording or screenshots in the PR body.
@iscekic iscekic closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant