Skip to content

F4: keep the hold through row-page errors and restore the anchor on Retry (#69) - #73

Merged
DavidVFitzGerald merged 3 commits into
mainfrom
fix/f4-hold-retry
Nov 15, 2026
Merged

DavidVFitzGerald merged 3 commits into
mainfrom
fix/f4-hold-retry

Conversation

@DavidVFitzGerald

Copy link
Copy Markdown
Owner

Refs #69

Behaviour change

  • Row-page error during the selection-change hold (any page after the first): the hold now pauses instead of ending. The previous comparison stays shown with the anchor flow in place; the partial new comparison is never committed or shown. The alert "Flow values could not be loaded." with Retry is shown; no summary or cell reads are issued; the status does not say "Updating the comparison…". The grid keeps aria-busy (documented in the README: its rows are still the previous selection's).
  • Retry resumes the hold (busy, "Updating…", row pages only) until an anchor flow is loaded or no pages remain, then the anchor is restored at its offset. Issue repro (jsdom, 30 ms): row 1150 at −20 px → row 1260 at −20 px (on main: row 1149 at −68 px, another flow). A repeated failure pauses the hold again.
  • Selection change while the error shows: a new hold starts from the still-shown previous comparison.
  • locate reports flows that may be on unfetched pages as unknown (undefined), never absent (null), even after an error.
  • First-page errors (0 rows + Retry) and errors outside a hold (loaded rows kept, Retry continues paging) are unchanged and now pinned by regression tests.

Root cause: useFlowGrid required !isError for seeking, so an error ended the hold and committed the partial comparison; after Retry pages were fetched only to viewport + lookahead, so the anchor (110 rows further down) was never loaded. The suspected locate contribution was checked by variants: locate change alone does not fix the repro (row 1149), the hold change alone does (row 1260). In the repro no loaded row of the partial comparison was in view, so the pins survived the nulls; the locate change is kept as required hardening.

Tests

  • New flows-grid-anchoring.test.tsx (harness moved to flows-grid-harness.ts): error-during-hold + Retry, repeated failure, selection change during the error, first-page error (O12), error outside a hold, and O9/O8 tests. Faults are injected per row page through the test's flowRows spy; the mock scenario and URL scenarios are unchanged.
  • D4 old-anchor offset check is now unconditional.
  • Mutants (scratch edits to ComparisonGrid.tsx, reverted, none committed): N5 (focus clause removed) killed by the O9 test; N6 (first pin only) killed by "anchors on a later recorded flow…"; N7 (no re-anchor when every pin is gone) killed by "re-anchors on the flows in view…". The three AC1 tests fail on the deb4f29 hook; the AC2/AC3 regressions pass on both.
  • Why the split: the pre-existing suite grows ~100 MB of heap per large-workload test (1.46 GB after 12 tests on main); one file with 20 tests hit the 2.2 GB worker heap limit (OOM). Clearing the query cache per test did not help. Existing assertions and the 20 s/40 s budgets are unchanged.

Container checks (workspace container, Compose project lca-diff-f4-hold-retry, port 5196)

docker compose --project-directory . -f compose.yaml -p lca-diff-f4-hold-retry exec -T workspace bash -lc 'cd /workspaces/lca-diff && npm --prefix apps/frontend run <script>'
Script Result
format:check pass
lint pass
typecheck pass
build pass
test:unit 30 files, 391 tests passed
test:e2e -- --project=chromium 26 passed (incl. flows-grid.spec.ts and all @smoke)

Slowest new test in the parallel unit run: O9 focus test 21.8 s (40 s per-test budget, same as the existing deep tests); #69 tests 8–9 s.

Limitations

  • No browser-level error repro (no URL fault injection, per the issue); the error paths are verified in jsdom.
  • O11 (hold length) and O13 (top-of-list policy) are out of scope and unchanged.
  • The ~100 MB/test heap growth of the large-workload jsdom suites is pre-existing and not investigated further here.

🤖 Generated with Claude Code

DavidVFitzGerald and others added 3 commits November 15, 2026 13:34
…(Refs #69)

A row-page error during the selection-change hold ended the hold and
committed the partial new comparison; Retry then paged only to the
viewport, so the anchor flow was never loaded and the view landed on
other flows. The hold now pauses while the error is shown (previous
comparison kept, no summary or cell reads, no "Updating" status, grid
still aria-busy) and resumes after a successful Retry. locate reports
flows on unfetched pages as unknown rather than absent, even after an
error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moves the large-workload Flows grid harness into flows-grid-harness.ts
and adds flows-grid-anchoring.test.tsx: an error during the hold then
Retry (the issue repro), a repeated failure, a selection change while
the error shows, the first-page error and error-outside-a-hold
regressions, plus tests killing #23 QA mutants N5, N6 and N7. Row-page
faults are injected through the flowRows spy. The D4 old-anchor offset
check is now unconditional. The suite is split because each test of
this workload adds about 100 MB to the worker heap and one file of 20
tests runs out of heap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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