Skip to content

payjoin-cli "send" doesn't propagate process_response errors correctly #1394

@spacebear21

Description

@spacebear21

Is there an existing issue for this?

  • I have searched the existing issues

Which crate is this issue for?

payjoin-cli

How did you obtain this crate?

Compiled from source

Features

No response

What version of the selected crate are you using?

latest master

Current behavior

I was curious what would happen if the sender configured a single ohttp_relay that corresponds to the same mailroom instance that the receiver selected as a directory.

This should fail due to self-loop detection, and it does, but from the sender perspective it's very unclear that it failed:

❯ cargo run -- send $BIP21 --fee-rate 1
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `/Users/spacebear/Projects/rust-payjoin/target/debug/payjoin-cli send 'bitcoin:bcrt1qj02zql5reqzaq8paa0u2sn5vhupm7wj3mpj8kc?amount=0.00001&pjos=0&pj=HTTPS://LETS.PAYJO.IN/ZKGXKG7QGCS6Y%23EX13X7266G-OH1QYPX0QQF0P5QF58EXXD20KVGPDH0W3SQR398ZMYHV5F9MKZFF8W8MGG-RK1QD2DWKW4JJ8NH30GP4QS5J5H8DQSHA88RZE3Z5FRU2DMNX06VSTDU' --fee-rate 1`
Bootstrapping private network transport over Oblivious HTTP
Posted original proposal..

It just prints "posted original proposal" immediately after making the http request, regardless of the response, then silently exits after process_response expectedly fails.

Expected behavior

It should not print "Posted original proposal.." until a successful response is confirmed, and in the case of failure it should print an error message.

Steps to reproduce

try doing a payjoin with payjoin-cli with the following configs:

receiver config.toml:

[v2]
pj_directory="https://lets.payjo.in"

sender config.toml:

[v2]
ohttp_relays=["https://lets.payjo.in"]

Relevant log output

No response

Operating system and version

macos

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueDoes NOT mean "an LLM can do this." Please discuss the constraints and intended approach.payjoin-cli

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions