Skip to content

fix(assets): give history cursor recovery epoch ownership - #13780

Closed
mattmillerai wants to merge 3 commits into
matt/fe-962-fe-adopt-cursor-pagination-in-the-generated-tab-jobs-sourcedfrom
matt/be-3420-history-fetch-epoch-ownership
Closed

mattmillerai wants to merge 3 commits into
matt/fe-962-fe-adopt-cursor-pagination-in-the-generated-tab-jobs-sourcedfrom
matt/be-3420-history-fetch-epoch-ownership

Conversation

@mattmillerai

@mattmillerai mattmillerai commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

ELI-5

When the history list hits a stale pagination cursor, it throws the list away and starts over from the top. But it forgot to tell everyone else "I just reset — ignore what you were doing." So if a background "check for new items" refresh was mid-flight, it could wake up and scribble on the freshly-cleared list, or trigger a needless full reload. This teaches the recovery path to raise the shared "generation counter" so those concurrent readers correctly bail — while making sure the recovery's own follow-up fetch isn't fooled into discarding its own result.

Summary

Stacked on #12769 (base branch), addressing a review follow-up deferred from it.

The cursor-recovery path (fetchHistoryPageWithCursorRecovery) cleared allHistoryItems/loadedIds/loadedJobIds/historyOffset/historyNextCursor/hadCursorThisWalk without incrementing historyFetchEpoch. Every other reset site (fetchHistoryAssets(false), replaceHistoryWithHeadPage) bumps the epoch, so a concurrent reader that captured the same epoch — notably an in-flight doRefreshHistoryHead, which fetches offset:0 directly and guards on the epoch — could pass its stale-check and act against the just-cleared list.

The clean fix couldn't be a one-liner: bumping the epoch inside recovery also trips loadMoreHistory's own stale-guard (suppressing a legitimate error) and fetchHistoryAssets's discard check (dropping the recovered page). A single counter can't tell self-recovery apart from external supersession without threading the post-recovery epoch back up.

Approach

Recovery now takes ownership of the walk: it bumps historyFetchEpoch and records the new value on a small mutable HistoryWalk holder threaded from loadMoreHistory → fetchHistoryAssets → the recovery fetcher. The caller and loadMoreHistory re-sync to that holder, so they honor their own self-recovery instead of misreading it as an external supersession. The bump + re-stamp happen before the fallback offset:0 fetch (synchronously, no await between), so even if that retry throws, the holder reflects the new epoch and the error still surfaces with the walk resumable from offset 0.

Preserved invariants (all covered by the existing concurrency suite):

  • (a) resumable-after-double-failure: reset before fallback fetch, error still surfaces (isLoadingMore released, next scroll not dropped).
  • (b) no discard of the recovered page.
  • (c) doRefreshHistoryHead now correctly bails when recovery reset the list mid-flight.

Tests

  • New: discards a concurrent head refresh when cursor recovery resets the walk mid-flight — the core regression (fails without the epoch bump: the un-guarded head refresh fires a spurious full reload, 5 fetches instead of 4).
  • Full assetsStore.test.ts suite green (125 tests), including the cursor/epoch concurrency cases.

Verification

  • pnpm test:unit src/stores/assetsStore.test.ts → 125 passed, against the tree with the base branch merged in.
  • pnpm typecheck, eslint, oxfmt --check clean.
  • Confirmed the new concurrency test still fails when the epoch bump is reverted (5 fetch calls vs the expected 4), proving it guards the regression.

Provenance

Verified: pnpm test:unit src/stores/assetsStore.test.ts → 125 passed with the base branch merged in; pnpm typecheck, eslint, and oxfmt --check clean; regression guard re-confirmed by reverting the epoch bump (5 fetches vs 4). Full pnpm test:unit run is green except scripts/cicd/check-binary-size.test.ts, which is inherited from the base branch and fails only on macOS (its check-binary-size.sh uses GNU-awk syntax that BSD awk rejects) — unrelated to this PR's two files.

Deviations: Merged the base branch in to resolve a semantic conflict that was invisible on the PR: the base reshaped JobsApiError to (status, body) and moved cursor classification onto the errorCode parsed from the body (#13781), so this branch's new race test still built the old (code, status) form and the INVALID_CURSOR escaped loadMoreHistory instead of triggering recovery. No textual conflict — it only reproduced in the merged result. Test updated to the structured form. Review threads were replied to but not resolved, per this repo's AGENTS.md rule that resolution is the reviewer's prerogative on PRs where the agent is the author.

Cursor recovery cleared the history walk state without bumping historyFetchEpoch, so a concurrent reader that captured the same epoch (notably an in-flight head refresh fetching offset:0) could pass its stale-guard and act on the just-cleared list.

Recovery now bumps the epoch and threads the new value through a mutable walk holder so its caller and loadMoreHistory re-sync to the self-recovery epoch instead of misreading their own reset as external supersession. The reset still runs before the fallback fetch, so a failed offset-0 retry leaves the walk resumable and surfaces the error.
@mattmillerai mattmillerai added agent-coded Opened by the agent-work code loop cursor-review Trigger multi-model Cursor agent review on this PR labels Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4c6b881d-4979-45eb-932c-2343ab72de92

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-3420-history-fetch-epoch-ownership

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 07/23/2026, 01:25:21 AM UTC

Links

🎭 Playwright: ✅ 1717 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1696 / ❌ 0 / ⚠️ 1 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.7 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 50.1 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.7 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.7 MB heap
large-graph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.6 MB heap
large-graph-pan: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 56.8 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.4 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.4 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.3 MB heap
subgraph-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.6 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.1 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 115ms TBT · 93.0 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.4 MB heap
vue-large-graph-idle: · 58.1 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 161.0 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 47ms TBT · 154.2 MB heap
workflow-execution: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 49.5 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 8ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 462ms
canvas-idle: script duration 23ms
canvas-idle: TBT 0ms
canvas-idle: heap used 69.7 MB
canvas-idle: DOM nodes 17
canvas-idle: event listeners 5
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 45ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 74
canvas-mouse-sweep: task duration 873ms
canvas-mouse-sweep: script duration 126ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 50.1 MB
canvas-mouse-sweep: DOM nodes -267
canvas-mouse-sweep: event listeners -133
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 18ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 32
canvas-zoom-sweep: task duration 326ms
canvas-zoom-sweep: script duration 21ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 72.7 MB
canvas-zoom-sweep: DOM nodes 79
canvas-zoom-sweep: event listeners 19
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 9ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 13
dom-widget-clipping: task duration 361ms
dom-widget-clipping: script duration 57ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 54.7 MB
dom-widget-clipping: DOM nodes 21
dom-widget-clipping: event listeners 1
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 8ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 8
large-graph-idle: task duration 580ms
large-graph-idle: script duration 94ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 61.6 MB
large-graph-idle: DOM nodes -269
large-graph-idle: event listeners -128
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 16ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 69
large-graph-pan: task duration 1163ms
large-graph-pan: script duration 409ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 56.8 MB
large-graph-pan: DOM nodes -269
large-graph-pan: event listeners -129
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 8ms
large-graph-zoom: style recalc duration 18ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 65
large-graph-zoom: task duration 1400ms
large-graph-zoom: script duration 493ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 55.4 MB
large-graph-zoom: DOM nodes -273
large-graph-zoom: event listeners -133
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 7ms
minimap-idle: layout count 0
minimap-idle: style recalc count 8
minimap-idle: task duration 579ms
minimap-idle: script duration 97ms
minimap-idle: TBT 0ms
minimap-idle: heap used 64.4 MB
minimap-idle: DOM nodes -268
minimap-idle: event listeners -128
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 9ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 46
subgraph-dom-widget-clipping: task duration 373ms
subgraph-dom-widget-clipping: script duration 125ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 55.3 MB
subgraph-dom-widget-clipping: DOM nodes 17
subgraph-dom-widget-clipping: event listeners 6
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 9ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 388ms
subgraph-idle: script duration 18ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 69.6 MB
subgraph-idle: DOM nodes 20
subgraph-idle: event listeners 4
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 39ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 756ms
subgraph-mouse-sweep: script duration 97ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 54.1 MB
subgraph-mouse-sweep: DOM nodes -99
subgraph-mouse-sweep: event listeners -65
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 12ms
subgraph-transition-enter: style recalc duration 29ms
subgraph-transition-enter: layout count 14
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 766ms
subgraph-transition-enter: script duration 29ms
subgraph-transition-enter: TBT 115ms
subgraph-transition-enter: heap used 93.0 MB
subgraph-transition-enter: DOM nodes 13673
subgraph-transition-enter: event listeners 2369
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 43ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 3803ms
viewport-pan-sweep: script duration 1181ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 71.4 MB
viewport-pan-sweep: DOM nodes -267
viewport-pan-sweep: event listeners -113
vue-large-graph-idle: avg frame time 17ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 13580ms
vue-large-graph-idle: script duration 534ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 161.0 MB
vue-large-graph-idle: DOM nodes -8311
vue-large-graph-idle: event listeners -16384
vue-large-graph-pan: avg frame time 17ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 16ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 103
vue-large-graph-pan: task duration 16614ms
vue-large-graph-pan: script duration 843ms
vue-large-graph-pan: TBT 47ms
vue-large-graph-pan: heap used 154.2 MB
vue-large-graph-pan: DOM nodes -8311
vue-large-graph-pan: event listeners -16383
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 20ms
workflow-execution: layout count 3
workflow-execution: style recalc count 14
workflow-execution: task duration 118ms
workflow-execution: script duration 12ms
workflow-execution: TBT 0ms
workflow-execution: heap used 49.5 MB
workflow-execution: DOM nodes 125
workflow-execution: event listeners 66
Raw data
{
  "timestamp": "2026-07-23T01:35:31.807Z",
  "gitSha": "bacd679b710ab9d14d1589d3bdcbd591e31cd7f6",
  "branch": "matt/be-3420-history-fetch-epoch-ownership",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2090.7299999999796,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 6.310000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 551.049,
      "heapDeltaBytes": 3863712,
      "heapUsedBytes": 73057832,
      "domNodes": 14,
      "jsHeapTotalBytes": 19546112,
      "scriptDurationMs": 27.473999999999997,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2021.9740000000002,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.958,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 372.369,
      "heapDeltaBytes": 3846132,
      "heapUsedBytes": 73177116,
      "domNodes": 20,
      "jsHeapTotalBytes": 19021824,
      "scriptDurationMs": 18.542999999999996,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1873.3839999999873,
      "styleRecalcs": 72,
      "styleRecalcDurationMs": 38.951,
      "layouts": 12,
      "layoutDurationMs": 3.987,
      "taskDurationMs": 891.692,
      "heapDeltaBytes": -16630520,
      "heapUsedBytes": 52525800,
      "domNodes": -267,
      "jsHeapTotalBytes": 19410944,
      "scriptDurationMs": 126.771,
      "eventListeners": -133,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1891.808000000026,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 51.235,
      "layouts": 12,
      "layoutDurationMs": 3.833,
      "taskDurationMs": 853.56,
      "heapDeltaBytes": -16824840,
      "heapUsedBytes": 52519600,
      "domNodes": -266,
      "jsHeapTotalBytes": 20197376,
      "scriptDurationMs": 124.78999999999998,
      "eventListeners": -133,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1755.788999999993,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 19.223999999999997,
      "layouts": 6,
      "layoutDurationMs": 0.8309999999999997,
      "taskDurationMs": 335.209,
      "heapDeltaBytes": 6910792,
      "heapUsedBytes": 75989824,
      "domNodes": 78,
      "jsHeapTotalBytes": 19808256,
      "scriptDurationMs": 22.199000000000005,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1679.8699999999371,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 17.628999999999998,
      "layouts": 6,
      "layoutDurationMs": 0.599,
      "taskDurationMs": 316.732,
      "heapDeltaBytes": 7184792,
      "heapUsedBytes": 76477440,
      "domNodes": 79,
      "jsHeapTotalBytes": 19021824,
      "scriptDurationMs": 19.903999999999996,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 562.4130000000491,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 8.047,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 374.551,
      "heapDeltaBytes": -11784024,
      "heapUsedBytes": 57319552,
      "domNodes": 18,
      "jsHeapTotalBytes": 19283968,
      "scriptDurationMs": 58.32,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 567.9149999999709,
      "styleRecalcs": 14,
      "styleRecalcDurationMs": 9.751000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 347.11800000000005,
      "heapDeltaBytes": -11757316,
      "heapUsedBytes": 57375552,
      "domNodes": 24,
      "jsHeapTotalBytes": 20332544,
      "scriptDurationMs": 55.62400000000001,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2035.1290000000404,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.481999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 583.699,
      "heapDeltaBytes": 5373300,
      "heapUsedBytes": 64784060,
      "domNodes": -268,
      "jsHeapTotalBytes": 4538368,
      "scriptDurationMs": 95.716,
      "eventListeners": -127,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2012.1339999999464,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.924,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 576.747,
      "heapDeltaBytes": 4805524,
      "heapUsedBytes": 64372804,
      "domNodes": -269,
      "jsHeapTotalBytes": 4276224,
      "scriptDurationMs": 91.818,
      "eventListeners": -129,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2136.4209999999844,
      "styleRecalcs": 68,
      "styleRecalcDurationMs": 15.885,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1150.587,
      "heapDeltaBytes": 1480268,
      "heapUsedBytes": 62626504,
      "domNodes": -269,
      "jsHeapTotalBytes": 5005312,
      "scriptDurationMs": 414.085,
      "eventListeners": -127,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2181.018999999992,
      "styleRecalcs": 69,
      "styleRecalcDurationMs": 15.285,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1175.425,
      "heapDeltaBytes": -4078520,
      "heapUsedBytes": 56487312,
      "domNodes": -269,
      "jsHeapTotalBytes": 5324800,
      "scriptDurationMs": 403.376,
      "eventListeners": -131,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3182.374999999979,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 16.566,
      "layouts": 60,
      "layoutDurationMs": 8.538,
      "taskDurationMs": 1397.95,
      "heapDeltaBytes": -3862060,
      "heapUsedBytes": 58099204,
      "domNodes": -272,
      "jsHeapTotalBytes": 7684096,
      "scriptDurationMs": 492.32699999999994,
      "eventListeners": -133,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3184.82999999992,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 19.559000000000005,
      "layouts": 60,
      "layoutDurationMs": 8.373000000000001,
      "taskDurationMs": 1402.284,
      "heapDeltaBytes": -4002224,
      "heapUsedBytes": 58122132,
      "domNodes": -273,
      "jsHeapTotalBytes": 8208384,
      "scriptDurationMs": 494.126,
      "eventListeners": -133,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2057.267999999965,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.77,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 565.677,
      "heapDeltaBytes": 6093972,
      "heapUsedBytes": 68648948,
      "domNodes": -266,
      "jsHeapTotalBytes": 4800512,
      "scriptDurationMs": 94.248,
      "eventListeners": -129,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "minimap-idle",
      "durationMs": 2027.1139999999832,
      "styleRecalcs": 6,
      "styleRecalcDurationMs": 6.115000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 591.794,
      "heapDeltaBytes": 5049768,
      "heapUsedBytes": 66505324,
      "domNodes": -269,
      "jsHeapTotalBytes": 3751936,
      "scriptDurationMs": 99.82400000000001,
      "eventListeners": -127,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 590.8430000000067,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 9.902,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 384.108,
      "heapDeltaBytes": -11157524,
      "heapUsedBytes": 58098764,
      "domNodes": 18,
      "jsHeapTotalBytes": 20594688,
      "scriptDurationMs": 127.84299999999999,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 550.7270000000517,
      "styleRecalcs": 45,
      "styleRecalcDurationMs": 8.689999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 362.385,
      "heapDeltaBytes": -11445800,
      "heapUsedBytes": 57847356,
      "domNodes": 16,
      "jsHeapTotalBytes": 20070400,
      "scriptDurationMs": 122.49700000000001,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2016.4849999999888,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 10.293000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 413.72900000000004,
      "heapDeltaBytes": 3603340,
      "heapUsedBytes": 73030200,
      "domNodes": 24,
      "jsHeapTotalBytes": 19283968,
      "scriptDurationMs": 20.245,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2004.1329999999675,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.332,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 361.85100000000006,
      "heapDeltaBytes": 3559140,
      "heapUsedBytes": 72894312,
      "domNodes": 16,
      "jsHeapTotalBytes": 19546112,
      "scriptDurationMs": 15.124,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1779.798000000028,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 41.369,
      "layouts": 16,
      "layoutDurationMs": 4.585999999999999,
      "taskDurationMs": 794.726,
      "heapDeltaBytes": -19856052,
      "heapUsedBytes": 49471192,
      "domNodes": -263,
      "jsHeapTotalBytes": 19148800,
      "scriptDurationMs": 99.22699999999999,
      "eventListeners": -133,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1690.266999999949,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 36.821000000000005,
      "layouts": 16,
      "layoutDurationMs": 4.509,
      "taskDurationMs": 716.981,
      "heapDeltaBytes": -5528572,
      "heapUsedBytes": 64040356,
      "domNodes": 65,
      "jsHeapTotalBytes": 19546112,
      "scriptDurationMs": 95.512,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 965.0720000000206,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 28.915999999999997,
      "layouts": 14,
      "layoutDurationMs": 11.562,
      "taskDurationMs": 765.8210000000001,
      "heapDeltaBytes": 30951920,
      "heapUsedBytes": 97528740,
      "domNodes": 13673,
      "jsHeapTotalBytes": 14680064,
      "scriptDurationMs": 28.645000000000003,
      "eventListeners": 2369,
      "totalBlockingTimeMs": 115,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8209.216999999968,
      "styleRecalcs": 249,
      "styleRecalcDurationMs": 43.034000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3862.262,
      "heapDeltaBytes": 15783868,
      "heapUsedBytes": 74974232,
      "domNodes": -268,
      "jsHeapTotalBytes": 7102464,
      "scriptDurationMs": 1196.9560000000001,
      "eventListeners": -113,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8139.683999999988,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 42.958999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3744.0870000000004,
      "heapDeltaBytes": 15268220,
      "heapUsedBytes": 74845108,
      "domNodes": -266,
      "jsHeapTotalBytes": 6578176,
      "scriptDurationMs": 1165.615,
      "eventListeners": -113,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 13516.824999999983,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 13494.735999999999,
      "heapDeltaBytes": -31472840,
      "heapUsedBytes": 171387860,
      "domNodes": -8311,
      "jsHeapTotalBytes": -10948608,
      "scriptDurationMs": 532.716,
      "eventListeners": -16384,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 13683.36499999998,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 13665.646000000002,
      "heapDeltaBytes": -60991208,
      "heapUsedBytes": 166154972,
      "domNodes": -8311,
      "jsHeapTotalBytes": -11730944,
      "scriptDurationMs": 536.014,
      "eventListeners": -16384,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 16736.829,
      "styleRecalcs": 103,
      "styleRecalcDurationMs": 16.761000000000024,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16710.698,
      "heapDeltaBytes": -55222152,
      "heapUsedBytes": 169329240,
      "domNodes": -8311,
      "jsHeapTotalBytes": -10420224,
      "scriptDurationMs": 831.9219999999999,
      "eventListeners": -16382,
      "totalBlockingTimeMs": 41,
      "frameDurationMs": 17.776666666666763,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 16545.394999999986,
      "styleRecalcs": 102,
      "styleRecalcDurationMs": 15.958000000000027,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16516.942,
      "heapDeltaBytes": -63445448,
      "heapUsedBytes": 154108720,
      "domNodes": -8311,
      "jsHeapTotalBytes": -16453632,
      "scriptDurationMs": 854.235,
      "eventListeners": -16384,
      "totalBlockingTimeMs": 52,
      "frameDurationMs": 17.219999999999953,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 456.50799999998526,
      "styleRecalcs": 13,
      "styleRecalcDurationMs": 18.793999999999997,
      "layouts": 3,
      "layoutDurationMs": 0.717,
      "taskDurationMs": 115.134,
      "heapDeltaBytes": -16509652,
      "heapUsedBytes": 51902332,
      "domNodes": 128,
      "jsHeapTotalBytes": 6701056,
      "scriptDurationMs": 9.856,
      "eventListeners": 67,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "workflow-execution",
      "durationMs": 459.51400000001286,
      "styleRecalcs": 15,
      "styleRecalcDurationMs": 21.075999999999997,
      "layouts": 3,
      "layoutDurationMs": 0.761,
      "taskDurationMs": 121.452,
      "heapDeltaBytes": -16613920,
      "heapUsedBytes": 51806712,
      "domNodes": 121,
      "jsHeapTotalBytes": 7487488,
      "scriptDurationMs": 13.650999999999998,
      "eventListeners": 65,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

✅ No high-signal findings.

Panel: 6/8 reviewers contributed findings.

Reviewers that did not contribute: kimi-k2.5:adversarial (empty), kimi-k2.5:edge-case (empty)

@mattmillerai
mattmillerai marked this pull request as ready for review July 18, 2026 01:36
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@                                             Coverage Diff                                              @@
##           matt/fe-962-fe-adopt-cursor-pagination-in-the-generated-tab-jobs-sourced   #13780      +/-   ##
============================================================================================================
- Coverage                                                                     76.27%   76.20%   -0.08%     
============================================================================================================
  Files                                                                          1696     1693       -3     
  Lines                                                                        118176   117745     -431     
  Branches                                                                      39060    38865     -195     
============================================================================================================
- Hits                                                                          90143    89725     -418     
+ Misses                                                                        27279    27266      -13     
  Partials                                                                        754      754              
Flag Coverage Δ
unit 67.75% <100.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/stores/assetsStore.ts 67.65% <100.00%> (-2.39%) ⬇️

... and 48 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ated-tab-jobs-sourced into matt/be-3420-history-fetch-epoch-ownership

# Conflicts:
#	src/stores/assetsStore.ts
Reconcile the base branch's JobsApiError(message, status) signature and
deferred cursor-recovery reset with this PR's epoch-ownership walk during
the merge: two tests still constructed JobsApiError with the pre-rename
arg order, and one asserted the pre-deferred-reset list length.

@DrJKL DrJKL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cursor-recovery race is real, and the new regression test fails against the base implementation as expected. The production fix keeps the recovering walk current while invalidating the concurrent head refresh.

Requesting changes because one added test duplicates an existing behavioral test, and the new race test includes step-by-step comments that repeat its code. The focused suite, typecheck, ESLint, Oxlint, and diff check otherwise pass.

expect(new Set(ids).size).toBe(ids.length)
})

it('releases isLoadingMore when the offset-0 recovery retry also fails, so the next scroll is not dropped', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test duplicates the preceding keeps pagination resumable when the offset-0 retry also fails case. That test already performs another loadMoreHistory(), asserts the fourth request, and checks the surfaced error, so it proves both that the guard released and that the walk adopted the recovery epoch. isLoadingMore is also released unconditionally in finally. Please delete this redundant test rather than adding another 35 lines for the same behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted. You are right that it was redundant: keeps pagination resumable when the offset-0 retry also fails already issues the follow-up loadMoreHistory() and asserts the fourth request lands, which can only happen once the guard released, and isLoadingMore is cleared unconditionally in finally. Removed in 90390f0.

)
await store.updateHistory()

// A head refresh captures the current epoch and issues its offset-0 fetch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the three added narration blocks from this test. The test name, controlled promise, mocked cursor failure, and before/after assertions already express each step. These comments paraphrase the code rather than preserving an invariant that the code cannot encode, contrary to the repository comment guidance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all three narration blocks in 90390f0. The test name, controlled promise, mocked cursor failure, and before/after assertions carry the sequence on their own.

@DrJKL DrJKL assigned AustinMroz and unassigned benjcooley and DrJKL Sep 1, 2026
@AustinMroz

Copy link
Copy Markdown
Collaborator

Fix has been subsumed by #15381

@AustinMroz AustinMroz closed this Sep 2, 2026
@mattmillerai

Copy link
Copy Markdown
Member Author

STACKED — merging lands on matt/fe-962-fe-adopt-cursor-pagination-in-the-generated-tab-jobs-sourced (base PR #12769, owned by @mattmillerai), NOT main.

Addressed both review threads in 90390f0:

  • Deleted the redundant releases isLoadingMore when the offset-0 recovery retry also fails test — the preceding keeps pagination resumable... case already asserts the fourth request lands, which only happens once the guard released.
  • Removed the three narration blocks from the concurrent-head-refresh race test.

Also fixed a semantic conflict with the base that was invisible here — the PR merges cleanly and its own CI is green, but the merged result failed. The base reshaped JobsApiError to (status, body) and moved cursor classification onto the errorCode parsed from the body (#13781); this branch's new race test still built the old (code, status) form, so isRejectedCursorError no longer matched and the INVALID_CURSOR escaped loadMoreHistory instead of triggering recovery. Base merged in and the test updated to the structured form (06062e4).

pnpm test:unit src/stores/assetsStore.test.ts → 125 passed on the merged tree; typecheck/eslint/oxfmt clean. Regression guard re-verified: reverting the epoch bump still fails the race test (5 fetches vs 4).

Threads replied to rather than resolved, per AGENTS.md — resolution is the reviewer's call on PRs where the agent is the author.

@mattmillerai
mattmillerai requested a review from DrJKL September 2, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Opened by the agent-work code loop cursor-review Trigger multi-model Cursor agent review on this PR size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants