Skip to content

Use full_relay_url in sender GET request#1166

Merged
spacebear21 merged 2 commits intopayjoin:masterfrom
spacebear21:fix-full-relay-url
Oct 21, 2025
Merged

Use full_relay_url in sender GET request#1166
spacebear21 merged 2 commits intopayjoin:masterfrom
spacebear21:fix-full-relay-url

Conversation

@spacebear21
Copy link
Collaborator

@spacebear21 spacebear21 commented Oct 21, 2025

This fixes an issue with directories other than the GATEWAY_ORIGIN specified by the OHTTP relay. Previously, attempting to use a different directory using the gateway opt-in mechanism resulted in an error due to the ohttp relay routing the sender request to the wrong directory:

[payjoin-cli/src/app/v2/mod.rs:499:13] &response = Response {                                                                                                                                                             url: "https://ohttp.cakewallet.com/",                                                                                                                                                                                 status: 400,
    headers: {                                                                                                                                                                                                                "server": "nginx/1.27.4",                                                                                                                                                                                             "date": "Tue, 21 Oct 2025 00:27:30 GMT",                                                                                                                                                                              "content-type": "application/problem+json",                                                                                                                                                                           "content-length": "103",
        "connection": "keep-alive",
        "access-control-allow-origin": "*",
    },
}
Transient error: The receiver sent an invalid response: v2 encapsulation error: Directory response error: Unexpected response size 103, expected 8192 bytes

The directory URL must be included in the path but was previously only included in POST requests (introduced in 8906c76). This includes it in GET requests as well.

I used Sonnet 4.5 for troubleshooting.

Pull Request Checklist

Please confirm the following before requesting review:

The directory URL must be included in the path but was previously only
included in POST requests (introduced in 8906c76). This includes it in
GET requests as well.
@coveralls
Copy link
Collaborator

coveralls commented Oct 21, 2025

Pull Request Test Coverage Report for Build 18670427278

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 83.743%

Totals Coverage Status
Change from base Build 18413003453: 0.006%
Covered Lines: 8953
Relevant Lines: 10691

💛 - Coveralls

This simplifies the extract_request() function signature and reduces
duplication.
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.

ACK f724e42

Great find. That directory 1-1 GATEWAY_URL backwards compatibility is gonna need to get removed once Bull Bitcoin Mobile and Cake upgrade. I do wonder if it makes more sense to enforce in the Request::new_v2 rather than the fn full_relay_url

@spacebear21 spacebear21 merged commit 3e30f4e into payjoin:master Oct 21, 2025
8 of 10 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.

3 participants