getAlby / lightning-browser-extension

The Bitcoin Lightning Browser extension that connects to different wallet interfaces and brings deep lightning integration to the web
https://getalby.com
MIT License
524 stars 192 forks source link

[BUG] Zap receipt ignores relay path #3170

Closed alexgleason closed 3 weeks ago

alexgleason commented 3 weeks ago

Is there an existing issue for this?

Describe the bug

When zapping a user, I include a relays tag in the zap request:

{
  "kind": 9734,
  "id": "108372bb7576f30ea139b7d41434cf6ca6aba842b244f55b0816fe901d3484b8",
  "pubkey": "0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd",
  "created_at": 1717775046,
  "tags": [
    [
      "e",
      "523482f258e244413951a20c29d65cd8f1c8326bebc11d2499c53a1f0096485c"
    ],
    [
      "p",
      "932614571afcbad4d17a191ee281e39eebbb41b93fac8fd87829622aeb112f4d"
    ],
    [
      "amount",
      "50000"
    ],
    [
      "relays",
      "wss://ditto.ngrok.app/relay"
    ],
    [
      "lnurl",
      "lnurl1dp68gurn8ghj7em9w3skccne9e3k7mf09emk2mrv944kummhdchkcmn4wfk8qtm6v9cx66c5ufl2g"
    ]
  ],
  "content": "",
  "sig": "52ece7a59505b334a6e5548e826537da5137012d7cd72ab6b7a79370ace9f38c2157db508357285a2fc5f3e812e3783ade52d36a50c62d4cad43221deb32e636"
}

Alby ignores the pathname of my relay (wss://ditto.ngrok.app/relay), and attempts to connect to the root (wss://ditto.ngrok.app/).

image

GET / HTTP/1.1
Host: ditto.ngrok.app
Accept-Encoding: gzip
Cdn-Loop: cloudflare; subreqs=1
Cf-Connecting-Ip: 2a06:98c0:3600::103
Cf-Ew-Via: 15
Cf-Ray: 8901c30f706c9b74-FRA
Cf-Visitor: {"scheme":"https"}
Cf-Worker: getalby.workers.dev
Connection: Upgrade
Sec-Websocket-Key: Kyrl3xl0SUDLva0Agk1s6A==
Sec-Websocket-Version: 13
Upgrade: websocket
X-Forwarded-For: 2a06:98c0:3600::103
X-Forwarded-For: 172.70.251.50
X-Forwarded-Host: ditto.ngrok.app
X-Forwarded-Proto: https
X-Forwarded-Proto: https

Screenshots [optional]

No response

Steps To Reproduce

.

Expected behavior

Alby connect to the relay by its full URL to send the zap receipt.

Alby information

.

Device information

No response

Additional context

No response

Are you working on this?

None

bumi commented 3 weeks ago

oh thanks for debugging and reporting this. confirmed and fixed. (can you confirm it works now?) Sorry about this. I am not sure when this error was introduced and sadly it was not noticed here.

patrickReiis commented 3 weeks ago

Hi @bumi, I was having this same problem with wss://slime.church/relay and I just tested and it works nicely and instantly. Thank you!

alexgleason commented 3 weeks ago

Thank you!