Repository navigation
#701 Drop the stale REST pool when live updates stall - #703
Merged
Merged
Conversation
ivanfenenko
marked this pull request as ready for review
October 16, 2026 20:43
Collaborator
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7898d00. Configure here.
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.
Summary
OpenCodeURLSessions.restand REST clients read that pool at request time. An injected test session stays fixed.onEvicthook toOpencodeHttpClient.rebuild().Checks
xcodebuild testOpenCodeURLSessionsTests+EventsAPIClientTestson iPhone 17 simulator. TEST SUCCEEDED (15 tests, 0 failures)../gradlew :app:testDebugUnitTest --tests dev.opencode.mobile.data.remote.EventsApiTest. BUILD SUCCESSFUL.Issue
Risks / Follow-ups
-1005after backgrounding, still leave the pool alone.Need help on this PR? Tag
@codesmithwith what you need.Note
Medium Risk
Replacing the REST pool cancels in-flight REST requests by design; scope is limited to SSE connect-budget failures, not ordinary transport errors.
Overview
When live updates stall because an SSE connect budget fires (hung handshake), the app now drops the process-wide REST pool so the next retry uses fresh sockets—matching what a full restart already did.
On iOS,
OpenCodeURLSessionsgainsreplaceRest()(swap + cancel the old pool). REST API clients no longer capture a fixedURLSession; they resolve the live pool at request time viarestResolver, while injected test sessions stay pinned.EventsAPIClienttakesonConnectBudgetExceededand DI wires it toreplaceRest().On Android,
sessionEventsApiconnects the existing SSEonEvicthook toOpencodeHttpClient.rebuild(), with DI and a unit test asserting a single rebuild on budget exceed.Tests cover pool replacement behavior and that the budget callback fires once without affecting injected SSE sessions.
Reviewed by Cursor Bugbot for commit 7898d00. Bugbot is set up for automated code reviews on this repo. Configure here.