Return error if session closed with a failure#1132
Closed
arminsabouri wants to merge 3 commits intopayjoin:masterfrom
Closed
Return error if session closed with a failure#1132arminsabouri wants to merge 3 commits intopayjoin:masterfrom
arminsabouri wants to merge 3 commits intopayjoin:masterfrom
Conversation
This was referenced Oct 1, 2025
Returning the current state encourages developers to repeat the action that caused the failure. Instead we should error out during session replays.
We always return Ok.
We can get rid of the hacky `ProtocolError` variant off `InternalReplayError` if we seperate event processing events from replay errors.
5d05c73 to
90dd688
Compare
Collaborator
Pull Request Test Coverage Report for Build 18199861996Details
💛 - Coveralls |
Contributor
|
I suppose this implies the presence of a closed event is insufficient to display failure in UI? On its face it doesn't seem like a closed session should throw an error which semantically describes exceptions. |
Collaborator
The closed event describes the outcome (e.g. failure) but no details about how it occurred. To do that we need the session history. The current approach is to return the current_state on replay of a Closed event, but @arminsabouri described in OP that it may be a footgun to keep returning the same state. There were two proposed solutions:
|
2 tasks
Collaborator
Collaborator
Author
|
superseded by #1132 |
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.
Returning the current state encourages developers to repeat the action that caused the failure. Instead we should error out during session replays.
Blocked by #1129 . Drafting for now. There is a TODO as well that I'd like to address. As of now, IIRC the application never recieves the error that fatally closed the session on a replay. If we include a stringified version of the error that would provide some visibility that previously TerminalFailure(String) provided. Please correct me if my assumption about this is incorrect.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.