Repository navigation
Conversation
EncapsulationError is a misnomer: it is exclusively raised when decapsulating responses (process_response), never during request encapsulation (create_v2_post_request / create_poll_request, which produce CreateRequestError). Rename to DecapsulationError so the type name matches its actual usage. Also rename the internal variant InternalValidationError:: V2Encapsulation to V2Decapsulation for consistency, and update the display string. Closes payjoin#749 partially.
Pull Request Test Coverage Report for Build 22572326812Details
💛 - Coveralls |
DanGould
force-pushed
the
session4/issue-749
branch
from
March 2, 2026 10:39
0acbd95 to
1c2e4d5
Compare
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
DanGould
force-pushed
the
session4/issue-749
branch
from
March 2, 2026 10:41
1c2e4d5 to
70e1364
Compare
Owner
Author
|
replaced by payjoin#1601 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit and rename error types for issue payjoin#749
Summary
EncapsulationErrortoDecapsulationError(and internal types)SessionError,CreateRequestError, and the formerEncapsulationErrorWhat changed
EncapsulationErrorwas a misnomer: it is exclusively raised whendecapsulating responses (
process_response), never during requestencapsulation (
create_v2_post_request/create_poll_request, whichproduce
CreateRequestError). Renamed toDecapsulationErrorthroughoutcore and FFI crates, including the
InternalValidationError::V2Encapsulationvariant (now
V2Decapsulation).Audit findings
Error type inventory
InternalCreateRequestErrorUrl,Hpke,OhttpEncapsulation,ExpiredInternalDecapsulationError(wasInternalEncapsulationError)Hpke,DirectoryResponseInternalSessionErrorParseUrl,Expired,OhttpEncapsulation,Hpke,DirectoryResponseDuplication between send and receive error types
InternalSessionErroris a superset containing all variants from bothInternalCreateRequestErrorandInternalDecapsulationError:Issues requiring maintainer decisions
Cross-side deduplication:
InternalCreateRequestErrorandInternalSessionErrorhave nearly identical variant sets but servedifferent sides of the protocol (send vs receive). Collapsing them
requires architectural decisions about shared error types.
Decapsulation/Session subset:
InternalDecapsulationErroris astrict subset of
InternalSessionError(Hpke+DirectoryResponse).Could potentially reuse a shared type.
Inconsistent variant naming:
Url(send) vsParseUrl(receive)for the same semantic concept (
into_url::Error).Hpke variant placement: The
Hpkevariant inDecapsulationErrorrepresents HPKE decryption (a distinct crypto operation from OHTTP
decapsulation). May belong at a different level.
process_response return type asymmetry: Send POST returns
DecapsulationError, send GET returnsResponseError. The asymmetrymay be intentional (POST only confirms acceptance; GET retrieves and
validates a full proposal).
Test plan
cargo clippy --all-targets --keep-going --all-features -- -D warningscargo fmt --all -- --checkcodespellnix fmt -- --ciDisclosure: co-authored by Claude