Skip to content

Session ids should be something other than raw increments in payjoin-cli #1631

Description

@benalleng

coming from #1558 (comment)

This references the liana integration where a review comment asked what would happen if a wallet was imported and tried to start a payjoin session where there were already existing payjoins. Would this cause an overlap or an error?

While we generally reference the session Id when creating a new payjoin session incrementing does cause a problem when both sender and receiver are treated separately such that this is what the history looks like.

Session ID   Sender/Receiver           Completed At    Status         
1            Sender                    Not Completed   Session expired at Time(Time(1780413414))
2            Sender                    1780327516      Session expired at Time(Time(1780413866))
1            Receiver                  Not Completed   Waiting for original proposal
2            Receiver                  Not Completed   Waiting for original proposal

The following command will be unable to resolve

payjoin-cli cancel 1

You will receive and error like so.

Error: Session 1 exists as both a sender and receiver session. Pass `--role sender` or `--role receiver`.

It seems like better UX to simply create random or timestamp based session ids to hold internally to better manage these individual sessions.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions