Skip to content

fix(ui): don't wipe the current project when a stale fetch rejects#321

Open
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/fetch-rejection-race
Open

fix(ui): don't wipe the current project when a stale fetch rejects#321
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/fetch-rejection-race

Conversation

@cavidelizade

Copy link
Copy Markdown
Contributor

Summary

The issue-list aggregate load guarded only the first setter in its .catch; the rest ran unconditionally. Opening project A then quickly switching to B — if A's request rejected after B had loaded — cleared B's issues/states/labels/cycles/modules and left an empty page for a perfectly valid project.

Linked issues

Closes #316

Type of change

  • Bug fix (fix:)

Surface

  • UI (apps/web/)

What changed

  • IssueListPage: replaced if (!cancelled) setWorkspace(null) (with 8 unguarded setters after it) with an early if (cancelled) return; so the whole reset is skipped for a stale request.
  • Applied the same one-line guard to ProjectsListPage and both loaders in PageHeader, which had the identical partial-guard pattern.

Why this approach

The cancelled flag already exists (flipped in each effect's cleanup); it was just applied to one line instead of the block. Early-returning the entire catch is the smallest correct fix and matches how the .then/.finally handlers in the same effects already guard.

Test plan

  • npm run typecheck + npm run lint pass
  • Manual: throttle the network, open project A, immediately switch to B; A's load loses the race and rejects → B stays intact (before this change B blanked out).

AI assistance

  • AI tools were used — tool(s): Claude Code (Opus 4.8) — commits carry a Co-Authored-By: trailer

The issue-list aggregate load guarded only the first setter in its .catch;
the remaining setters ran unconditionally. Opening project A then quickly
switching to B, if A's request rejected after B loaded, cleared B's
issues/states/labels/cycles/modules and showed an empty page for a valid
project. Guard the whole catch body with the cancelled flag. Same one-line
guard applied to ProjectsListPage and the two PageHeader loaders.

Closes Devlaner#316

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cavidelizade
cavidelizade requested a review from a team as a code owner July 16, 2026 09:59
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cavidelizade, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb031693-7c1a-468e-b4ca-421839bbc1a6

📥 Commits

Reviewing files that changed from the base of the PR and between a81f6a3 and 84c568b.

📒 Files selected for processing (3)
  • apps/web/src/components/layout/PageHeader.tsx
  • apps/web/src/pages/IssueListPage.tsx
  • apps/web/src/pages/ProjectsListPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cavidelizade

Copy link
Copy Markdown
Contributor Author

@martian56 #316 — on the issue list, a background request rejecting after you'd already switched projects would blank out the project you were looking at (only the first setter was guarded). Guarded the whole catch across the list page and the two other spots with the same pattern. Green, no open comments. Good to merge?

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.

Rejected background fetch clears the currently-viewed project on the issue list

1 participant