Skip to content

Instantiate v2::Reciver only after data persistence is complete#560

Closed
arminsabouri wants to merge 2 commits intopayjoin:masterfrom
arminsabouri:ephemeral-reciever
Closed

Instantiate v2::Reciver only after data persistence is complete#560
arminsabouri wants to merge 2 commits intopayjoin:masterfrom
arminsabouri:ephemeral-reciever

Conversation

@arminsabouri
Copy link
Collaborator

In order to ensure the application has persisted the reciver session before they can use it to handle an proposal we first wrap the reciver in a EphemeralReciver struct. Indicating to the application that data will be lost unless it it properly persited via EphemeralReciver::persist().

This work is meant to supersedes #552. But I wanted to open a second Pr so we can compare implementation details.

Issue: #336

@arminsabouri arminsabouri requested a review from DanGould March 4, 2025 14:22
@arminsabouri arminsabouri force-pushed the ephemeral-reciever branch 2 times, most recently from b4f62e4 to 81f4bc8 Compare March 4, 2025 14:26
@coveralls
Copy link
Collaborator

coveralls commented Mar 4, 2025

Pull Request Test Coverage Report for Build 13812455333

Details

  • 59 of 60 (98.33%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 79.816%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/send/v2/mod.rs 20 21 95.24%
Files with Coverage Reduction New Missed Lines %
payjoin/src/directory.rs 1 92.0%
Totals Coverage Status
Change from base Build 13792137471: 0.1%
Covered Lines: 4607
Relevant Lines: 5772

💛 - Coveralls

Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

Thank you for taking a stab at what I asked for. I don't find it particularly beautiful but also not particularly horrible. Hoping @nothingmuch can chime in with thoughts.

@DanGould DanGould marked this pull request as draft March 4, 2025 18:47
Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

Since this affects the API, and we're nearing a release, I'd like to hold off on merging the individual bit for just the receiver half until we're confident this is the right design. And then I'd like to address sender at the same time so we have one fell swoop of API changes regarding persistence. That's why I converted it to draft.

Sincerely hoping to get @nothingmuch's input on this design and better understand the other options before approving

In order to ensure the application has persisted the reciver session
before they can use it to handle an proposal we first wrap the reciver
in a `EphemeralReciver` struct. Indicating to the application that data
will be lost unless it it properly persited via
`EphemeralReciver::persist()`.

Issue: payjoin#336
@spacebear21
Copy link
Collaborator

Superseded by #552

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants