Repository navigation
Clear agent-connect timeout when a session ends early - #1469
Merged
Merged
Conversation
useAgentTimeoutIdStore kept the timer id in React state, so the cleanup in useAgent called a clearAgentTimeout captured in an earlier render where the id was still null. The timer was never cleared, and if the session ended within the timeout window it could fire later and fail a newly started session. Store the timer id in a ref so start/clear always see the current timer. This also makes both callbacks stable. Fixes #1468 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 74e7ea2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Drop the effect harness and call the store's callbacks directly, using the exported DEFAULT_AGENT_CONNECT_TIMEOUT_MILLISECONDS for the timeout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
thomasyuill-livekit
approved these changes
Oct 12, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
useAgentTimeoutIdStorekept the timer id in React state, so the cleanup in useAgent called aclearAgentTimeoutcaptured in an earlier render where the timeout id was stillnull. Because of this, the timer was never cleared, and therefore if the session ended within the timeout window it could fire later and cause an unrelated /newly started session to fail.To fix this, store the timer id in a ref so start/clear always see the current timer. This also makes both callbacks have stable stable references, as a nice side effect.
I have tested this locally and starting a session, then waiting a few seconds, then stopping, then starting again wil lwait the full 20s before throwing an error.
Fixes #1468