fix: SIP connect hang - arm timeout before await connect#340
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughHook initialization now records connect start time and races Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
b5ed56e to
fdb2f68
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/hooks/use-telnyx.ts`:
- Around line 744-753: The stuck-connecting branch in ensureRegistered detects a
connection hang (connectionStatusRef.current === 'connecting' and elapsed >
REGISTRATION_TIMEOUT_MS) but only calls runLifecycleRecovery('connect-timeout')
which merely schedules another ensureRegistered and will be deduped, so it never
forces a reconnect; change this to call
triggerManualReconnect('connect-timeout') (the same recovery used in other
failure paths) instead of or in addition to runLifecycleRecovery so the client
actually disconnects/reinits when the connect timeout is reached; update the
call site in ensureRegistered (and keep runLifecycleRecovery if you want logging
scheduling still) and ensure triggerManualReconnect is invoked with the
'connect-timeout' reason.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2e30ffe9-815a-4754-96e6-7181ec0192d9
📒 Files selected for processing (1)
src/hooks/use-telnyx.ts
* fix: prevent SIP connect hang during telnyx init * fix: trigger reconnect on stuck connecting detection
Fixes agents stuck on WebRTC connecting forever. Timeout now races against connect(), and ensureRegistered recovers from stuck connecting state.
Summary by CodeRabbit