fix(github): break infinite PR sync loop and improve diff panel targeting (#503)

This commit is contained in:
Carlos Florêncio
2026-03-31 00:25:51 +01:00
committed by GitHub
parent c56dfe8537
commit c0b801a45a
4 changed files with 266 additions and 9 deletions
+6 -4
View File
@@ -64,14 +64,16 @@ export function useTaskPR(taskId: string | null) {
retryRef.current = 0;
}, [taskId]);
// Sync once when the task becomes active (freshness check).
// Intentionally excludes `pr` so WS-driven store updates don't re-trigger.
useEffect(() => {
if (!taskId) return;
// Always sync once when the task becomes active (freshness)
refresh();
}, [taskId, refresh]);
// If no PR in store yet, retry periodically until found
if (pr) return;
// Retry polling when no PR is in the store yet.
useEffect(() => {
if (!taskId || pr) return;
const interval = setInterval(() => {
if (retryRef.current >= SYNC_MAX_RETRIES) {