-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: gracefully handle streaming hangups when the server dies unexpec…
…ted (#2358) ## Why is this change needed? Fixes #2346. Under certain conditions, like a hub failure or odd connectivity quirks, the fetch can hang indefinitely, leading to a need for consumers to restart if they aren't timeout driven. This avoids the issue by setting a sensible timeout and returning failure in the event it can't complete the request. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on improving the handling of server streaming timeouts and errors in the `shuttle` package, ensuring graceful termination of unresponsive connections and adding corresponding tests. ### Detailed summary - Added timeout handling to prevent hanging connections in `packages/shuttle/src/shuttle/messageReconciliation.ts`. - Updated promise resolution logic to handle server timeout errors. - Implemented a test case in `packages/shuttle/src/shuttle.integration.test.ts` for unresponsive server requests. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
1 parent
7370ee4
commit 386059a
Showing
3 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@farcaster/shuttle": patch | ||
--- | ||
|
||
fix: gracefully handle streaming hangups when the server dies unexpected |
This file contains 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
This file contains 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