Skip to content

Cli cancel UX#1700

Open
benalleng wants to merge 3 commits into
payjoin:masterfrom
benalleng:cli-UI-additions
Open

Cli cancel UX#1700
benalleng wants to merge 3 commits into
payjoin:masterfrom
benalleng:cli-UI-additions

Conversation

@benalleng

Copy link
Copy Markdown
Collaborator

This PR builds on #1688 but reverts the completed_at DB column removal.

  • Add an auto-cancel mid loop when passing the expiry instead of only on process start.
  • print the session ID at the start of the session to better keep track if the user want to immediately cancel.
  • Show what sessions have a fallback transaction available from payjoin-cli history for rebroadcasting.

example output. custom timeout of 20s to demonstrate automatic cancel logic
image

Coded with help from GLM-5.2

Pull Request Checklist

Please confirm the following before requesting review:

@benalleng benalleng requested a review from spacebear21 June 30, 2026 17:26
@benalleng

Copy link
Copy Markdown
Collaborator Author

@spacebear21 I am most curious of your thoughts on 9b718ac and whether you think this is appropriate for both the sender and receiver

@coveralls

coveralls commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28619046692

Coverage decreased (-0.1%) to 85.838%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 38 uncovered changes across 2 files (83 of 121 lines covered, 68.6%).
  • 13 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
payjoin-cli/src/app/v2/mod.rs 100 63 63.0%
payjoin/src/core/error.rs 10 9 90.0%
Total (5 files) 121 83 68.6%

Coverage Regressions

13 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
payjoin-cli/src/app/v2/mod.rs 13 53.06%

Coverage Stats

Coverage Status
Relevant Lines: 15612
Covered Lines: 13401
Line Coverage: 85.84%
Coverage Strength: 353.42 hits per line

💛 - Coveralls

@bc1cindy bc1cindy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks solid

two notes inline on the expiry paths.

the new mid-loop cancel/broadcast and the fallback_available display aren't covered by tests

adding a test driving an expired session through the sender path would lock in the behavior, wdyt?

Comment thread payjoin-cli/src/app/v2/mod.rs
Comment thread payjoin-cli/src/app/v2/mod.rs
Before this change there was no reasonable way of knowing which session
had a fallback transaction available meaning that if the session was
closed with `payjoin-cli cancel # --no-broadcast` a user would have to enumerate
through all the sessions trying to look for which session had the
fallback tx.
This ensures that the session id is printed immediately after session id
creation ensuring that the session id is displayed at the earliest
moment it is readable.
@benalleng benalleng force-pushed the cli-UI-additions branch 3 times, most recently from c91653e to 597ffe4 Compare July 2, 2026 18:46
@benalleng benalleng requested a review from bc1cindy July 2, 2026 19:58
Previously the cli only checked for expiry at program start during long
polling loops there was not an expiry check leading to the possiblity of
an indefinite poll past expiry where the counterparty had already given
up.

This also adds an `--expire-in` flag for the receiver to both test this
functionality and demonstrate that the receiver is not actually fixed to
a 24hr expiration and is in controll of this expiry time.
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