pendulum-chain / vortex

1 stars 0 forks source link

Stop flow early if user changes the offramping amount on anchor UI #129

Closed TorstenStueber closed 1 week ago

TorstenStueber commented 3 weeks ago

The user is able to alter the offramping amount on the anchor UI. In that case the flow will fail as the offramping transaction we construct uses the original offramping amount, whereas the anchor expects the altered offramping amount.

We will be able to detect the offramping amount the user enters on the anchor UI and will be able to avoid a situation where the amounts differ.

TODO

TorstenStueber commented 3 weeks ago

@prayagd this will prevent that we start the offramping flow if the user alters the offramping amount. What kind of error message shall we show and how shall we display it? This happens once the anchor UI flow is completed (i.e., once we can close the anchor iframe) and once the user arrives on the progress page.

I think it should not be the default error screen as it makes it look like an error in Vortex itself, although this problem is on a different level.

TorstenStueber commented 3 weeks ago

Hey team! Please add your planning poker estimate with Zenhub @b-yap @bogdanS98 @ebma @gianfra-t @Sharqiewicz

ebma commented 2 weeks ago

I think it should not be the default error screen as it makes it look like an error in Vortex itself, although this problem is on a different level.

@TorstenStueber How about we introduce toast notifications and show this as an error notification instead? The notification could say something like "Mismatching offramp amounts detected. Please retry starting the offramp but don't change the amount that is prefilled in the UI of our partner."

TorstenStueber commented 1 week ago

We could do that if it works well also on mobile. Also: what if the user is still on the anchor UI tab and would miss the toast? Otherwise, we can just generally show a conventional error message on the main screen.

vadaynujra commented 1 week ago

@ebma We want to show a message to the user when they click the button that kicks off the anchor flow. With that in mind, I think it is fine to block the user transaction in case we get a response back from SEP24 that the user altered the amount, and can show an error on these lines.

ebma commented 1 week ago

@vadaynujra this doesn't answer the question. We cannot show an error message immediately when the user clicks the button to offramp, as that button will first open the external window where they could change the amount. Only when the user fills in the form and amount and returns to the prototype page, will we be able to know if there was a mismatch.

Please have a look at this comment/question.