Skip to content

Refresh pull request status when turns complete - #1025

Merged
ymichael merged 2 commits into
mainfrom
bb/pr-thread-ui-not-updating-thr_ydqz5kp6qw
Aug 5, 2026
Merged

Refresh pull request status when turns complete#1025
ymichael merged 2 commits into
mainfrom
bb/pr-thread-ui-not-updating-thr_ydqz5kp6qw

Conversation

@ymichael

@ymichael ymichael commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • invalidate the active environment pull request query when a thread turn completes
  • catch PRs created remotely by an agent even when no local workspace change follows gh pr create
  • add a regression test covering an actively observed PR query changing from absent to available without navigation

Validation

  • pnpm exec turbo run test --filter=@bb/app --force (312 files, 2,346 tests passed)
  • pnpm exec turbo run typecheck --filter=@bb/app
  • git diff --check

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and end-to-end behavior.

Stack: #1025 — Refresh pull request status when turns complete.

I found no later pull requests in this stack. I skipped no pull requests.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

Security review complete.

I found no security issues. The realtime event type has schema validation. The existing pull request route keeps its environment and workspace checks.

The change adds no new wire field, command input, data exposure, or cache write. It only invalidates an existing query after a completed turn.

Comment thread apps/app/src/hooks/cache-owners/realtime-cache-registry.ts Outdated

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

Code-quality review complete.

I found one medium cache-scope issue. A sidebar pull request observer can exist without a cached thread-detail query.

The handler then cannot find the environment. The sidebar pull request badge stays stale after a completed turn.

I also confirmed one formatting issue. Prettier reports the changed registry file.

The focused test and the app type check pass.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

Performance review complete.

I found no blocking performance issue. The handler uses one exact query key and causes no request without an active observer.

One low-cost concern remains. Each completed turn can run a GitHub lookup for a merged or closed pull request.

A burst from threads in one environment can also repeat the same invalidation. A later cache change should keep one request per environment.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

End-to-end review complete.

I opened the live app at the reviewed SHA. I sent a follow-up through the browser composer.

The browser received the turn/completed realtime message. It sent the environment pull request request one millisecond later.

The interface showed pull request #1025. The tested thread-detail flow passed.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

Review result: one medium issue and one low issue.

  • Medium: The handler reads only the thread-detail cache. A sidebar observer can exist without that cache entry.
  • The sidebar pull request badge can stay stale for an unopened thread or a sibling thread.
  • Low: Prettier reports the changed registry file.
  • Performance: No blocking issue exists. Settled pull requests and shared environments can still cause extra GitHub lookups.
  • Security: I found no security issue.

The main thread-detail flow passed the browser test. A turn/completed message caused a pull request request one millisecond later.

The focused test passed all 40 cases. The Turbo app type check passed.

Use the existing cached thread-list helper for the environment fallback. This avoids a new cache search pattern.

I recommend that the author add the fallback and run Prettier before merge.

@ymichael
ymichael merged commit 12caae0 into main Aug 5, 2026
10 checks passed
@ymichael
ymichael deleted the bb/pr-thread-ui-not-updating-thr_ydqz5kp6qw branch August 5, 2026 19:02
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.

2 participants