Repository navigation
Conversation
An FDv2 stream event with invalid JSON produced two INTERRUPTED updates. The event handler yielded one with INVALID_DATA and re-raised, and the SSE client gave the re-raised error to the error handler, which yielded a second one with UNKNOWN. The data source status then reported UNKNOWN as the last error. Any other error raised while handling an event was also reported twice. The event handler now only logs and re-raises. The error handler reports the error once, and maps JSON::ParserError to INVALID_DATA, as the FDv1 stream did.
This branch has not been 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.
An FDv2 stream event with invalid JSON produced two INTERRUPTED updates.
The event handler yielded one with INVALID_DATA and re-raised, and the
SSE client gave the re-raised error to the error handler, which yielded
a second one with UNKNOWN. The data source status then reported UNKNOWN
as the last error. Any other error raised while handling an event was
also reported twice.
The event handler now only logs and re-raises. The error handler reports
the error once, and maps JSON::ParserError to INVALID_DATA, as the FDv1
stream did.
Note
Overview
Fixes duplicate data source status updates when FDv2 streaming fails while handling an SSE event. Previously
on_eventemitted anINTERRUPTEDupdate (includingINVALID_DATAfor bad JSON), then re-raised soon_erroremitted a secondINTERRUPTEDwithUNKNOWN, which often became the reported last error.on_eventnow only logs and re-raises;handle_erroris the single place that yields status updates.JSON::ParserErroris handled there withINVALID_DATA, matching FDv1 streaming behavior.Specs cover
handle_errorfor invalid JSON and an integration case that expects exactlyINTERRUPTED→VALIDafter reconnect when the first event is malformed JSON.Reviewed by Cursor Bugbot for commit f07f51c. Bugbot is set up for automated code reviews on this repo. Configure here.