Fix relay reconnect notification loop#47
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMainLayout now computes ChangesRelay readiness and remote client deduplication
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
app/app/(main)/_layout.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/app/(main)/_layout.tsx (1)
132-140:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDon’t block local shared-session reconciliation on relay readiness.
Line 134 returns before the
activeSharebranch runs, so a shared session no longer updatesprojectsAtom/ selection state while the relay is reconnecting. That branch is local state sync, not relay-backed polling, so this widens the pause beyond the PR goal.Suggested fix
async function loop() { if (cancelled) return; - if (!relayReadyForRequests) return; if (activeShare) { reconcileProjects([projectFromActiveShare(activeShare)]); store.set(selectedProjectPathAtom, activeShare.projectRoot); store.set(selectedSessionIdAtom, activeShare.sessionId); timer = setTimeout(loop, POLL_INTERVAL_MS); return; } + if (!relayReadyForRequests) return; try { const token = await getToken(); const projects = await listProjects({ token });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/app/`(main)/_layout.tsx around lines 132 - 140, The loop function currently returns early when !relayReadyForRequests which prevents the activeShare handling from running; move or split the checks so that activeShare reconciliation always runs regardless of relayReadyForRequests. Specifically, in the loop function (symbols: loop, relayReadyForRequests, activeShare, reconcileProjects, projectFromActiveShare, store.set(selectedProjectPathAtom), store.set(selectedSessionIdAtom), timer, POLL_INTERVAL_MS) ensure the activeShare branch executes before or independent of the relay readiness check and still schedules the next timer; only the relay-backed polling logic should be skipped when relayReadyForRequests is false.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@app/app/`(main)/_layout.tsx:
- Around line 132-140: The loop function currently returns early when
!relayReadyForRequests which prevents the activeShare handling from running;
move or split the checks so that activeShare reconciliation always runs
regardless of relayReadyForRequests. Specifically, in the loop function
(symbols: loop, relayReadyForRequests, activeShare, reconcileProjects,
projectFromActiveShare, store.set(selectedProjectPathAtom),
store.set(selectedSessionIdAtom), timer, POLL_INTERVAL_MS) ensure the
activeShare branch executes before or independent of the relay readiness check
and still schedules the next timer; only the relay-backed polling logic should
be skipped when relayReadyForRequests is false.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dadadd9f-f4e5-48fe-b47c-d4b9a1d9dccb
📒 Files selected for processing (3)
app/app/(main)/_layout.tsxsrc/relay-client.test.tssrc/relay-client.ts
|
Fixed in a9678ce - shared-session reconciliation now runs before the relay-readiness gate, so only relay-backed polling pauses during reconnect. |
Summary
Verification
Summary by CodeRabbit
Bug Fixes
Tests