Skip to content

Address #17 follow-ups to prep release 0.2.0 - #18

Merged
DanGould merged 4 commits into
payjoin:masterfrom
DanGould:release-0.2.0
Nov 11, 2026
Merged

DanGould merged 4 commits into
payjoin:masterfrom
DanGould:release-0.2.0

Conversation

@DanGould

Copy link
Copy Markdown
Member

Follow up #17 with @benalleng 's requested changes

Pinging @caarloshenriq for parallel review because this builds on a lot of his work

Co-authored with Claude Code

Uri::parse stops reading parameters at the first # after the ?, so an
unencoded # inside a value truncates it and silently drops every
parameter after it. A BIP 77 pj URL carries its keys in a fragment, so
this is the case a payjoin sender hits. Say so in the parse docs, and
that the fix is to write # as %23.

unsatisfied_requirements reports req-amount, req-label and the other
keys this crate parses unless the caller lists them, because parsing a
value is not acting on it. Say so in its docs and in the example, which
a wallet copying it would otherwise get wrong.
std is not a default feature, so cargo test alone never builds the std
code paths. Run the tests a second time with --all-features on every
toolchain in the matrix, including the 1.63 job.
Uri::parse matches keys literally, so %61mount is an unknown key, not
amount. RFC 3986 section 2.3 makes the two equivalent, though, so a
reader that decodes keys before matching would see amount. A URI with
an escaped key means different things to different parsers.

The builder used to accept a key with valid escapes. Reject any % in a
key instead, so a URI this crate builds never carries that ambiguity.
Raw values still take escapes.
Turn the Unreleased section into 0.2.0 and rewrite it for someone
upgrading from 0.1. The main thing a 0.1 user has to act on was missing:
0.1 rejected an unknown req- parameter at parse time, and 0.2 parses it
and leaves the check to unsatisfied_requirements. Also list the removed
fields, constructors and types, the case-insensitive keys, and the
stricter bc/tb/bcrt values.

Point the README at the changelog instead of calling 0.2 unstable, and
add bip321 to the crate keywords.
@DanGould
DanGould requested a review from benalleng November 10, 2026 07:42
@DanGould DanGould changed the title Release 0.2.0 Address #17 follow-ups to prep release 0.2.0 Nov 10, 2026

@caarloshenriq caarloshenriq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ACK 4735116

Checked the new # docs against the parser: an unencoded # in pj drops the amount and label after it, and %23 keeps all three. Every symbol the changelog names exists and is exported

Thanks for taking the req- note. One small question inline about escaped keys on the parse side

Comment thread src/builder.rs
/// emitting an escape in a key keeps every reader on the same meaning.
fn key_round_trips(key: &str) -> bool {
is_qchars(key) && !params::base_key(key).is_empty()
is_qchars(key) && !key.contains('%') && !params::base_key(key).is_empty()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes sense for the builder. On the parse side, Uri::parse still takes %61mount=1 as an unknown key, so this crate ignores it while a reader that decodes keys sees an amount. Rejecting it at parse time would probably go against BIP 321’s grammar, but a line in the parse docs, like the new one about #, would tell consumers about that divergence. Not blocking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Please feel free to pr as a follow-up since this can be in a patch release

@benalleng benalleng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK 4735116

@DanGould
DanGould merged commit 9c7e8d1 into payjoin:master Nov 11, 2026
6 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