get10101 / 10101

10101 (Ten-Ten-One): Self-custodial derivative trading at your fingertips.
https://10101.finance
MIT License
128 stars 23 forks source link

fix: Make onboarding a bit more robust when coordinator is down #2603

Closed Restioson closed 2 months ago

Restioson commented 4 months ago

This PR adds two related commits which do the following:

  1. Show an error to the user if the coordinator is down (or unavailable) during onboarding instead of just hanging
  2. If the coordinator is down during onboarding, try to register them for the beta program the next time they launch the app instead of just leaving them unregistered.

This might address #2430 somewhat, but I'm currently unclear exactly what the issue with #2430 is.

holzeis commented 4 months ago

I think we can't delay the user registration to the next start as the user might trade once the coordinator is back online. This will result in errors if the user is not registered.

Restioson commented 4 months ago

I think we can't delay the user registration to the next start as the user might trade once the coordinator is back online. This will result in errors if the user is not registered.

Is the user able to create a position whilst the coordinator is offline? Or is this in the case of the coordinator coming back whilst the user is still online?

Restioson commented 3 months ago

Perhaps this could be addressed by checking if the user is registered every time before they open a position?

holzeis commented 3 months ago

Is the user able to create a position whilst the coordinator is offline? Or is this in the case of the coordinator coming back whilst the user is still online?

If the coordinator is coming back, while the user is online.

holzeis commented 3 months ago

Perhaps this could be addressed by checking if the user is registered every time before they open a position?

I wouldn't make it too complicated.. I think your solution of simply retrying to register, when the app starts the next time is fine.

holzeis commented 3 months ago

@Restioson This feels a bit weird. I would go for the warning we already show when you open the app after you have registered. "Coordinator is not available" but show the app.

https://github.com/get10101/10101/assets/382048/0ef791b4-af9e-496e-926a-39defebedc19

Restioson commented 3 months ago

@holzeis: I've gone for showing both warnings. Now, it will still show that you have failed to register for beta but also continue to wallet and then show that the coordinator is offline. I did not want to simply silence the failure to register for beta as I think the user should still know about it.

holzeis commented 3 months ago

@holzeis: I've gone for showing both warnings. Now, it will still show that you have failed to register for beta but also continue to wallet and then show that the coordinator is offline. I did not want to simply silence the failure to register for beta as I think the user should still know about it.

Can you share a video.. I would like to see how this looks like. There was also the issue of a hanging loading screen.

Restioson commented 3 months ago

For future reference: @holzeis and I discussed that the additional warning about beta signup should be removed, since there is no observable effect of this failure (it's only internal). If this changes, like if we add an email notification or the like, we could consider reintroducing it as an extra line on the main 'coordinator down' warning.

Restioson commented 3 months ago

I changed it to a snackbar just to make it consistent with the import seed which does the same thing when it's LoadingScreenTask fails. I did it in such a way that I can remove it very easily though if you think it should go though @holzeis, on purpose :smile:

holzeis commented 3 months ago

I changed it to a snackbar just to make it consistent with the import seed which does the same thing when it's LoadingScreenTask fails. I did it in such a way that I can remove it very easily though if you think it should go though @holzeis, on purpose 😄

Sounds reasonable to me, can you share a video?

Restioson commented 3 months ago

Kazam_screencast_00002.webm