benthecarman / zapple-pay-backend

16 stars 3 forks source link

Duplicate tips? #21

Closed alexgleason closed 8 months ago

alexgleason commented 9 months ago

I sent a tip and got charged 3 times:

image

12 Feb 24 - 13:34
- 500 sats
Payment Hash: 20b2ef37a0c212999418792c78b0b35b057845f39c552057cb7eccabde2ac430
Preimage: ac6fbc3808759cdf1ec9ba922199cb60c6ec089d8e40dc115bcc4b2098a4a4e6

12 Feb 24 - 13:33
- 500 sats
Payment Hash: 19e5c9ff81eddb00de458ea9848ac650f5637ef52136e176b50ebb716089ce6a
Preimage: d3f5ac6400e7cb6aa8065d1aba4990c697fc03ee161f953028d8121db35dfbb0

12 Feb 24 - 13:33
- 500 sats
Payment Hash: c883f5b4a3a34903d52265881fb70a3ee572506fcf5f18331187939d9a5677ba
Preimage: f10e12c2258210eeb811fa9a83ef65199b94abd452caf1799ff6dd752ed83022

My npub is npub108pv4cg5ag52nq082kd5leu9ffrn2gdg6g4xdwatn73y36uzplmq9uyev6

I have registered multiple times under the same npub, but in Alby's NWC I revoked all except one. So I'm not sure if this is a problem with race conditions in Zapple Pay, or if it's an issue with Alby's NWC not respecting when I remove a connection.

Maybe something to discover in the logs?

benthecarman commented 8 months ago
Feb 12 13:33:13 suredbits-laptop zapple-pay[3639696]:  DEBUG zapple_pay::listener             > Received reaction: f460cd4f782b2fb7a635a31ef5d7db715a9b694771f129e4cbf4849b781985bd ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6
Feb 12 13:33:14 suredbits-laptop zapple-pay[3639696]:  INFO  zapple_pay::listener             > Successful reaction: f460cd4f782b2fb7a635a31ef5d7db715a9b694771f129e4cbf4849b781985bd ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6
Feb 12 13:33:41 suredbits-laptop zapple-pay[3639696]:  DEBUG zapple_pay::listener             > Received reaction: f72f598108a79f82bb87d18c1f6b522e892209d98d43ade9e647bb140883f4ad ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6
Feb 12 13:33:42 suredbits-laptop zapple-pay[3639696]:  INFO  zapple_pay::listener             > Successful reaction: f72f598108a79f82bb87d18c1f6b522e892209d98d43ade9e647bb140883f4ad ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6
Feb 12 13:34:10 suredbits-laptop zapple-pay[3639696]:  DEBUG zapple_pay::listener             > Received reaction: 2fa59954ba3c2f387d9306e76d5bbef0a00ee572e2d9c6f37f05e4785518ffef ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6
Feb 12 13:34:11 suredbits-laptop zapple-pay[3639696]:  INFO  zapple_pay::listener             > Successful reaction: 2fa59954ba3c2f387d9306e76d5bbef0a00ee572e2d9c6f37f05e4785518ffef ⚡ 79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6

i received all the reactions and sent the nwc requests out. It looks like they are all going to different people so seems to be valid.

alexgleason commented 8 months ago

Thank you for the info. Those looks like the bridge is actually producing multiple reactions for the same ActivityPub activity. So it's a problem with the bridge. I'm adding a cache to make it idempotent, then I'll close this issue.

alexgleason commented 8 months ago

Fixed by https://gitlab.com/soapbox-pub/mostr/-/merge_requests/101/diffs