Revolutionizing Error Handling: A Strategic Update to Hub Subscriber Disconnects!
New logic ensures accurate reflection of retry attempts, paving the way for smoother subscriber experiences.
Commit Details:
fix: update where we emit errors on hub subscriber disconnects (#2629) ## Why is this change needed? Emitting here ensures that the `stopped` state properly reflects whether a retry will happen. ## 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 error handling in the `hubSubscriber` by adjusting when errors are emitted during subscriber disconnects. It ensures that the `stopped` state accurately reflects whether a retry will occur after a delay. ### Detailed summary - Modified the error emission logic to occur after a sleep period. - Added a comment explaining the rationale for checking the `stopped` state post-sleep. - Ensured that if the subscription is stopped, it logs an abort message instead of retrying. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->