Skip to content

fix(list): 🐛 Prevent cloud task progress regression on page navigation#66

Merged
jorben merged 3 commits into
masterfrom
fix/cloud-task-progress-merge
May 8, 2026
Merged

fix(list): 🐛 Prevent cloud task progress regression on page navigation#66
jorben merged 3 commits into
masterfrom
fix/cloud-task-progress-merge

Conversation

@jorben

@jorben jorben commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add module-level cloudProgressCache that persists across component mount/unmount cycles
  • Merge progress from API response, React state, and cache using Math.max to prevent regression
  • Clean up cache entries when tasks reach terminal states (completed/cancelled/failed)

Root Cause

When navigating away from and back to the task list, the List component remounts with empty state. fetchTasks then returns cloud API data with stale pages_completed (due to server write latency), causing progress to jump back to 0%. SSE events that previously updated progress are lost because React state resets on unmount.

Solution

A module-level Map (cloudProgressCache) stores SSE-driven progress updates outside the React lifecycle. On every fetchTasks call, the merge logic takes the maximum of three sources: API data, current React state, and the persistent cache.

Test Plan

  • Navigate to list while cloud tasks are processing — progress should not flash to 0%
  • Switch to task detail and return — progress remains monotonically increasing
  • New tasks (not in cache) display API-provided progress correctly
  • Completed/cancelled tasks are removed from cache (no memory leak)
  • All 935 existing tests pass ✅

🤖 Generated with TiyCode

jorben added 3 commits May 8, 2026 11:42
… remount

The previous Math.max merge was ineffective because prevData is empty
when the List component remounts (after navigation). This fix introduces
a module-level cloudProgressCache that persists across mount/unmount
cycles, ensuring SSE-driven progress is never lost when fetchTasks
returns stale API data.

- Cache is updated on every SSE event (page_completed, completed, etc.)
- fetchTasks merges API data with both React state AND the cache
- Cache entries are cleaned up when tasks reach terminal states
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

AI Code Review Summary

PR: #66 (fix(list): 🐛 Prevent cloud task progress regression on page navigation)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Address the highest severity findings first and add targeted tests for changed logic.

Potential Risks

  • Potential hidden risks remain in edge cases not covered by the current diff context.

Test Suggestions

  • Add happy-path + boundary + failure-path tests for touched modules.

File-Level Coverage Notes

  • src/renderer/pages/List.tsx: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 1
  • Covered files: 0
  • Uncovered files: 1
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • src/renderer/pages/List.tsx: coverage_incomplete

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 1
  • Executed batches: 1
  • Sub-agent runs: 1
  • Planner calls: 2
  • Reviewer calls: 2
  • Model calls: 4/64
  • Structured-output summary-only degradation: YES

Reasons:

  • planner_structured_output_failed_round_1: Structured output failed after repair: 404 The requested model is not included in your subscription plan. Please create a Pay-As-You-Go API Key to access this model, or check available models for your plan at
  • reviewer_structured_output_failed_round_1_general: Structured output failed after repair: 404 The requested model is not included in your subscription plan. Please create a Pay-As-You-Go API Key to access this model, or check available models for your plan at

@jorben
jorben merged commit d4c62bc into master May 8, 2026
3 checks passed
@jorben
jorben deleted the fix/cloud-task-progress-merge branch May 8, 2026 05:05
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