svthalia / Reaxit

The latest ThaliApp built on Flutter.
GNU General Public License v3.0
11 stars 3 forks source link

Thalia Pay sales dialog opens twice, #455

Closed DeD1rk closed 9 months ago

DeD1rk commented 1 year ago

Describe the bug

I've heard, but not yet seen, that when you pay with thalia pay for a sales order, the dialog stays open after paying. Might not be accurate but worth trying out.

How to reproduce

Pray to the demo-gods.

JAicewizard commented 1 year ago

Is there any way we can try to reproduce this next meeting? You're more fimiliar with thaliapay so we'll probably need to figure it out together

DeD1rk commented 1 year ago

We can just give it a try on staging

DeD1rk commented 1 year ago

Almost forgot, but I reproduced on the borrel. It felt to me like the problem was that the sales dialog stays open until the payment succeeds, but the confirmation dialog closes immediately when you push the button. So as the server is apparently quite slow, that allows you to press 'pay' multiple times.

Here's a video. I started it a bit late but clear enough. https://github.com/svthalia/Reaxit/assets/41264528/17596c8d-727a-4605-a583-85c99205c5c4

Also, I think before the 'pay' request can be sent, the 'claim order' request must also have finished. So probably we also need to temporarily disable the pay button until that's done. Possibly the first few paying attempts fail because of the order not having been claimed yet?

DeD1rk commented 11 months ago

While the website should prevent saving duplicate payments, it turns out in some cases it had a race condition. I'll try to fix that ASAP, but we also have to prevent it in the app as much as possible.