Skip to content

Conversation

@DanGould
Copy link
Contributor

@DanGould DanGould commented Jun 26, 2025

The big change here is moving SessionContext out of receive::v2::State and into Receiver since it's common between every state. I still think there's an optimization to be done w.r.t. e / reply key, which does belong in specific State objects and ought to be done before this release so we don't have to do a migration after this release.

I got rid of the changes moving SessionContext into Receiver because 1. it's not name related and 2. it's trickier than I thought because you've got to mutate the state of OhttpKeys in the context which requires some mutex behavior to do if you don't just own it, and hav eit in an arc between states instead.

I was also getting confused by the similar Receiver<State> and ReceiverTypeState type names, so I went with ReceiveSession for the enum, which may not have initialized a Receiver yet, and might have even failed. This rename pattern was applied to SenderTypeState as well. I kept "Receive" in "ReceiveSession" to disambiguate between Sessions for payjoin-ffi since the disambiguation applies to payjoin-cli/v2 for the time being until that module is separated into send/receive submodules as well.

@DanGould DanGould marked this pull request as draft June 26, 2025 16:16
@coveralls
Copy link
Collaborator

coveralls commented Jun 26, 2025

Pull Request Test Coverage Report for Build 15931307783

Details

  • 54 of 66 (81.82%) changed or added relevant lines in 5 files are covered.
  • 36 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.7%) to 85.492%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/send/v2/mod.rs 6 9 66.67%
payjoin-cli/src/app/v2/mod.rs 7 16 43.75%
Files with Coverage Reduction New Missed Lines %
payjoin-directory/src/lib.rs 1 75.0%
payjoin/src/ohttp.rs 1 70.97%
payjoin/src/receive/mod.rs 1 98.13%
payjoin/src/receive/multiparty/mod.rs 1 89.86%
payjoin/src/receive/v1/mod.rs 1 95.74%
payjoin/src/receive/v2/session.rs 1 93.96%
payjoin/src/send/v1.rs 1 94.7%
payjoin/src/send/v2/mod.rs 1 88.13%
payjoin-test-utils/src/lib.rs 1 94.41%
payjoin-cli/src/app/config.rs 2 81.58%
Totals Coverage Status
Change from base Build 15905219803: -0.7%
Covered Lines: 7254
Relevant Lines: 8485

💛 - Coveralls

@DanGould DanGould force-pushed the arc-sc branch 4 times, most recently from 2b63d80 to 05099a4 Compare June 26, 2025 22:51
It contains every possible state of a session including initialized
Receiver types. Include the module `Receive` name to disambiguate
the public type used in payjoin-ffi where namespacing is not yet
available.
@DanGould DanGould marked this pull request as ready for review June 27, 2025 04:51
@DanGould DanGould requested a review from spacebear21 June 27, 2025 04:51
/// and the state to be updated with the next event over a uniform interface.
#[derive(Debug, Clone, PartialEq)]
pub enum ReceiverTypeState {
pub enum ReceiveSession {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I kept "Receive" in "ReceiveSession" to disambiguate between Sessions for payjoin-ffi since the disambiguation applies to payjoin-cli/v2 for the time being until that module is separated into send/receive submodules as well.

wdyt about going further and just calling this (and SendSession) both Session, favoring qualified imports and in the ffi module pub use receive::Session as ReceiveSession?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the issue is that payoin-ffi doesn't wrap around the rust-payjoin enums but reimplements them (the inner variants wrap the corresponding rust-payjoin types). So using the same names makes it easier to navigate and use the API based on rust docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I had them named Session at first and would prefer that but uniffi is out lowest common denominator

DanGould added 2 commits June 27, 2025 12:35
It contains every possible state of a session including
Sender types. Include the module `Send` name to disambiguate
the public type used in payjoin-ffi where namespacing is not yet
available.
@DanGould
Copy link
Contributor Author

fixed commit message

@DanGould DanGould requested a review from spacebear21 June 27, 2025 17:35
@spacebear21 spacebear21 merged commit 3626678 into payjoin:master Jun 27, 2025
13 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.

4 participants