Skip to content

PjParam should have minimal pub methods #1064

Closed

Description

@nothingmuch

only the receiver_pubkey method needs to be pub (because payjoin-cli uses the value), but ohttp_keys, expiration and endpoint only need to be accessed internally to the payjoin crate after the URI has been built

Activity

  1. DanGould commented on Sep 12, 2025

    @DanGould
    Member

    One part of this I'm still not completely happy with is the visibility of the getter methods on v2::PjParams. receiver_pubkey is used in payjoin-cli as a session-id parameter. The v2::PjParams::endpoint method is only used in payjoin-ffi, and I can't help but wonder if that's a mistake vestigial of the old way we were indexing sessions by endpoint before receiver_pubkey was used for indexing, as in payjoin-cli, related to #336. The other public getters for ohttp_keys and expiration are unused and can be made more private, though I'd like to give them holistic consideration the context of all of the getters.

    Originally posted by @DanGould in #1048 (comment)

  2. DanGould commented on Sep 12, 2025

    @DanGould
    Member

    In #995 we decided to use receiver_pubkey as the index. Upon reflection @nothingmuch mentioned that the comparison with Urls might be a better user experience even if receiver_pubkey is used to disambiguate. Yuval may you shed some light on how you'd like this fully realized?

  3. nothingmuch commented on Sep 12, 2025

    @nothingmuch
    ContributorAuthor

    comparing by RK should be done first, and payjoin-cli should error if that's ever duplicated.

    as a special case, we can check if the full URI is identical if that happens (ideally by comparing the URI as a string, not just the fields we recognize in our extras struct) and soften the error to instruct the sender to use the resume command instead of just complaining about a duplicate RK

  4. nothingmuch commented on Sep 17, 2025

    @nothingmuch
    ContributorAuthor

    closed by #1082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions