Allow cancel on closed sessions to reprint fallback tx#1673
Merged
Conversation
Collaborator
Coverage Report for CI Build 28129265564Coverage increased (+0.1%) to 85.517%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
69e64b8 to
1cd38f7
Compare
bc1cindy
reviewed
Jun 24, 2026
Comment on lines
+294
to
+314
| /// Look up a sender session by ID regardless of active/inactive state. | ||
| pub(crate) fn find_send_session(&self, session_id: &SessionId) -> Result<bool> { | ||
| let conn = self.get_connection()?; | ||
| let exists: bool = conn.query_row( | ||
| "SELECT EXISTS(SELECT 1 FROM send_sessions WHERE session_id = ?1)", | ||
| params![session_id.0], | ||
| |row| row.get(0), | ||
| )?; | ||
| Ok(exists) | ||
| } | ||
|
|
||
| /// Look up a receiver session by ID regardless of active/inactive state. | ||
| pub(crate) fn find_recv_session(&self, session_id: &SessionId) -> Result<bool> { | ||
| let conn = self.get_connection()?; | ||
| let exists: bool = conn.query_row( | ||
| "SELECT EXISTS(SELECT 1 FROM receive_sessions WHERE session_id = ?1)", | ||
| params![session_id.0], | ||
| |row| row.get(0), | ||
| )?; | ||
| Ok(exists) | ||
| } |
Contributor
There was a problem hiding this comment.
nit: find_* reads like it returns the session (find usually yields Option<T>), but this returns bool. wdyt? would *_exists match the return type better?
| } | ||
|
|
||
| /// Look up a sender session by ID regardless of active/inactive state. | ||
| pub(crate) fn find_send_session(&self, session_id: &SessionId) -> Result<bool> { |
Contributor
There was a problem hiding this comment.
worth a test pinning down the regression: create a session, close it, assert find_send_session returns true (the old get_send_session_ids would've returned empty for a closed session)
Contributor
|
concept ACK |
c830d3e to
ad792ea
Compare
spacebear21
approved these changes
Jun 24, 2026
spacebear21
left a comment
Collaborator
There was a problem hiding this comment.
utACK but I have one small change request on the e2e test if it's trivial enough to add.
Print the fallback tx hex from SessionHistory::fallback_tx() in the Closed(Aborted) arm of cancel_sender_session and cancel_receiver_session.
ad792ea to
9bb3d97
Compare
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.
Closes #1605
This adds the ability to run cancel on already closed sessions to re-print the fallback tx to be broadcast. This addresses a failure state where a closed session could not access its fallback tx if it was not automatically broadcast.
Coded with help from GLM-5.2
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.