Skip to content

fix(staged): propagate git errors and reload timeline after cache invalidation#640

Merged
matt2e merged 2 commits intomainfrom
still-not-seeing-commits-after-add-from-pr
Apr 16, 2026
Merged

fix(staged): propagate git errors and reload timeline after cache invalidation#640
matt2e merged 2 commits intomainfrom
still-not-seeing-commits-after-add-from-pr

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Apr 16, 2026

Summary

  • Propagate git errors from build_branch_timeline instead of silently swallowing them, so callers can react to failures
  • Dispatch timeline-invalidated custom events when branch timeline caches are cleared, and listen for them in BranchCard to trigger a re-fetch
  • Prevent stale async responses in ProjectHome from overwriting worktreePath with null when it's already set

Test plan

  • Create a project from a PR and verify commits appear in the timeline without needing a manual refresh
  • Verify git errors in timeline building surface to the UI instead of showing an empty commit list
  • Confirm that rapid project reloads don't cause worktreePath to flicker to null

🤖 Generated with Claude Code

matt2e and others added 2 commits April 16, 2026 13:52
…le worktreePath overwrites

Two fixes for commits not appearing after project-from-PR creation:

1. Dispatch 'timeline-invalidated' CustomEvent from invalidateBranchTimeline
   and invalidateProjectBranchTimelines, and listen for it in BranchCard to
   trigger a re-fetch — previously the loadedTimelineKey guard prevented
   re-loading after cache invalidation.

2. Merge branches in the project-setup-progress handler to preserve
   worktreePath when a stale async response would overwrite it with null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… them

Previously, get_commits_since_base errors were silently caught and
replaced with an empty vec, which the frontend then cached as a valid
empty timeline. This caused commits to appear missing when transient
git errors (e.g., ref-lock races during concurrent worktree setup)
occurred during the initial timeline load. By propagating the error,
the frontend's cache-on-success logic ensures failed loads aren't
cached and will be retried.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners April 16, 2026 04:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cff4a38aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +520 to +521
if (branchIds.includes(branch.id) && (branch.worktreePath || isRemote)) {
void loadTimeline();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate invalidation reload on remote workspace readiness

The new timeline-invalidated listener reloads whenever isRemote is true, even if the remote workspace is not running. In this repo, invalidateProjectBranchTimelines(...) is fired during project setup refreshes, so stopped/starting remote branch cards will now call loadTimeline() and hit get_branch_timeline while the workspace is unavailable, producing avoidable backend errors and noisy/flickering UI error state. This should use the same readiness guard as the main timeline-load effect (remote status must be running) before triggering a reload.

Useful? React with 👍 / 👎.

@matt2e matt2e merged commit c3e70af into main Apr 16, 2026
5 checks passed
@matt2e matt2e deleted the still-not-seeing-commits-after-add-from-pr branch April 16, 2026 04:19
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