Page MenuHomePhabricator

[native] Refocus ConnectEthereum if registration fails due to expired nonce
ClosedPublic

Authored by ashoat on May 13 2024, 1:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 2:01 AM
Unknown Object (File)
Sat, Nov 2, 2:01 AM
Unknown Object (File)
Sat, Nov 2, 1:59 AM
Unknown Object (File)
Nov 1 2024, 7:00 PM
Unknown Object (File)
Nov 1 2024, 4:23 AM
Unknown Object (File)
Sep 26 2024, 3:00 AM
Unknown Object (File)
Sep 26 2024, 3:00 AM
Unknown Object (File)
Sep 26 2024, 3:00 AM
Subscribers

Details

Summary

Prior to this diff stack, when registration fails due to an expired nonce we would dismiss the entire RegistrationNavigator.

This diff addresses ENG-4087 by making sure we refocus the ConnectEthereum screen when we get an expired nonce error.

I had to introduce RegistrationRouter here so that we could intelligently refocus ConnectEthereum, even if it's missing from the navigation stack.

Depends on D12018

Test Plan

I tested this diff as follows:

  1. Be in a multi-keyserver environment, testing SIWE with iOS simulator
  2. Do a SIWE and then wait 2 minutes to let the nonce expire in the following screens:
    • FullscreenSIWEPanel for an account that doesn't exist yet when the new registration flow is disabled
    • FullscreenSIWEPanel for an account that doesn't exist yet when the new registration flow is enabled
    • FullscreenSIWEPanel for an account that does exist
    • New registration flow for an account that doesn't exist yet (RegistrationTerms)
    • New registration flow for an account that does exist (ExistingEthereumAccount)
  3. Make sure there are no duplicate Alerts, that in all cases an Alert is shown, and that the "back" action activates when the user confirms the Alert

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/account/registration/registration-navigator.react.js
67 ↗(On Diff #40134)

Unfortunately, the only way to use a custom router is to define a custom navigator. This was modelled after the other custom stack navigators we have, such as the one in native/chat/chat.react.js

123 ↗(On Diff #40134)

Without this change, the content was rendering over the header

native/account/registration/registration-terms.react.js
68–69 ↗(On Diff #40134)

These two lines are the reason that the prior diff is needed

This revision is now accepted and ready to land.May 14 2024, 6:17 AM