Skip to content

Return closed session state during replays#1136

Merged
arminsabouri merged 1 commit intopayjoin:masterfrom
arminsabouri:ressurect-terminal-failure
Oct 2, 2025
Merged

Return closed session state during replays#1136
arminsabouri merged 1 commit intopayjoin:masterfrom
arminsabouri:ressurect-terminal-failure

Conversation

@arminsabouri
Copy link
Collaborator

@arminsabouri arminsabouri commented Oct 2, 2025

We want to avoid returning the current state if a closed event was
processed from the log. The application may just perform the event that
caused the error instead of treating the session as terminally closed.

An alternative approach to #1132

Pull Request Checklist

Please confirm the following before requesting review:

AI disclosure: Cursor autocomplete used

@arminsabouri arminsabouri force-pushed the ressurect-terminal-failure branch 2 times, most recently from db66aad to 245ae09 Compare October 2, 2025 18:31
@arminsabouri arminsabouri changed the title WIP - Return closed session state during replays Return closed session state during replays Oct 2, 2025
@arminsabouri arminsabouri marked this pull request as ready for review October 2, 2025 18:31
@coveralls
Copy link
Collaborator

coveralls commented Oct 2, 2025

Pull Request Test Coverage Report for Build 18202314393

Details

  • 4 of 18 (22.22%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.09%) to 84.562%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/core/send/v2/mod.rs 0 1 0.0%
payjoin/src/core/receive/v2/mod.rs 2 4 50.0%
payjoin-cli/src/app/v2/mod.rs 0 11 0.0%
Files with Coverage Reduction New Missed Lines %
payjoin-cli/src/app/v2/mod.rs 1 58.06%
payjoin/src/core/receive/v2/mod.rs 2 91.04%
Totals Coverage Status
Change from base Build 18201782608: -0.09%
Covered Lines: 8961
Relevant Lines: 10597

💛 - Coveralls

ReceiveSession::PayjoinProposal(r) => r.session_context,
ReceiveSession::HasReplyableError(r) => r.session_context,
ReceiveSession::Monitor(r) => r.session_context,
ReceiveSession::Closed(_) => unreachable!(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should just return ReceiveSession::Closed(outcome)? In this case it doesn't hurt to return the same state since nothing can be done with it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Done

We want to avoid returning the current state if a closed event was
processed from the log. The application may just perform the event that
caused the error instead of treating the session as terminally closed.
@arminsabouri arminsabouri force-pushed the ressurect-terminal-failure branch from 245ae09 to 8f03b4c Compare October 2, 2025 18:37
Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approach ACK + code ACK 8f03b4c

@arminsabouri arminsabouri merged commit f476146 into payjoin:master Oct 2, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants