Skip to content

Expose Retryability Metadata#1430

Draft
chavic wants to merge 1 commit intopayjoin:masterfrom
chavic:chavic/retry-expiration-metadata-1272
Draft

Expose Retryability Metadata#1430
chavic wants to merge 1 commit intopayjoin:masterfrom
chavic:chavic/retry-expiration-metadata-1272

Conversation

@chavic
Copy link
Copy Markdown
Collaborator

@chavic chavic commented Mar 20, 2026

Closes #1272.

This PR surfaces retryability and expiration metadata through the existing sender, receiver, transport, and replay error wrappers. Core already knew when a session had expired and when certain transport failures were retryable, but that information was not being exported over FFI, so bindings had to treat many failures as opaque.

The change adds retryability helpers and expiration timestamp accessors where that information already existed in core, then exports those through the current UniFFI object wrappers rather than introducing a new exception hierarchy. That keeps the branch focused on metadata instead of replaying the broader structural refactors from adjacent issues.

The result is that bindings can now distinguish expired sessions from retryable directory failures and make sane retry or abandon decisions without parsing human-readable messages. This gives cross-language clients the lifecycle metadata they need while staying additive and low-risk.

Add retryability and expiration accessors to the core v2 session,
transport, replay, and response errors, then export the same
metadata through the existing UniFFI object wrappers.

This lets bindings distinguish expired sessions from transient
directory failures without parsing display strings or collapsing
everything into opaque transport errors.
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 23355436753

Details

  • 120 of 129 (93.02%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 84.269%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/core/send/v2/error.rs 30 32 93.75%
payjoin/src/core/receive/error.rs 24 27 88.89%
payjoin/src/core/send/error.rs 24 28 85.71%
Totals Coverage Status
Change from base Build 23300212261: 0.1%
Covered Lines: 10773
Relevant Lines: 12784

💛 - Coveralls

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.

Add retryability and expiration metadata to FFI error types

2 participants