• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DanGould / rust-payjoin / 25547534759

07 May 2026 06:32PM UTC coverage: 85.066% (-0.001%) from 85.067%
25547534759

push

github

DanGould
Disambiguate session IDs with s/r prefix

Sender and receiver session ids auto-increment per table, so
`send_sessions.id = 1` and `recv_sessions.id = 1` routinely coexist.
The previous `payjoin-cli fallback <i64>` dispatcher consulted the
sender table first, then the receiver table, then erred. A user who
meant their receive session 1 silently got their send session 1
fallen-back, broadcasting the wrong original.

Require an authoritative side prefix on every fallback invocation:
`s<n>` for sender, `r<n>` for receiver. Bare numeric input is rejected
with a usage error that names the expected format. The dispatcher
matches on the prefix; no table-existence guess is involved.

Introduce a small `SessionRef` enum with `FromStr` + `Display`
(round-trips, rejects bare numeric, prefix-only, unknown prefix,
negative, internal whitespace, overflow). Wire it through `App::fallback`
on both v1 and v2, and through every operator-visible display site that
currently prints a bare numeric id: `history` rows, the send-payjoin
failure/interrupt hints, the `fallback_sender` / `fallback_receiver`
status messages, and the `process_sender_session` end-of-session hint.
Drop `Database::has_send_session` / `has_recv_session`; they were added
in the previous commit purely to power auto-dispatch and have no other
callers.

Update both fallback e2e tests to feed the prefixed ref.

Without this, every operator with one of each session role open is
one typo away from broadcasting the wrong original.

80 of 99 new or added lines in 4 files covered. (80.81%)

11597 of 13633 relevant lines covered (85.07%)

401.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.51
/payjoin-cli/src/cli/session_ref.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc