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.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 20, 2026

Coverage Report for CI Build 24466348066

Coverage increased (+0.1%) to 84.488%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 9 uncovered changes across 3 files (126 of 135 lines covered, 93.33%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
payjoin/src/core/send/error.rs 28 24 85.71%
payjoin/src/core/receive/error.rs 27 24 88.89%
payjoin/src/core/send/v2/error.rs 32 30 93.75%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12938
Covered Lines: 10931
Line Coverage: 84.49%
Coverage Strength: 408.14 hits per line

💛 - Coveralls

@chavic chavic force-pushed the chavic/retry-expiration-metadata-1272 branch from 23af96e to 0b9fa5f Compare April 5, 2026 21:46
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.
@chavic chavic force-pushed the chavic/retry-expiration-metadata-1272 branch from 0b9fa5f to 8e36a85 Compare April 15, 2026 16:36
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