Page MenuHomePhabricator

[native] Prevent user from leaving RegistrationTerms during registration request
ClosedPublic

Authored by ashoat on Apr 30 2024, 12:45 PM.
Tags
None
Referenced Files
F3528597: D11849.diff
Tue, Dec 24, 9:42 AM
Unknown Object (File)
Sat, Dec 21, 2:56 PM
Unknown Object (File)
Sat, Dec 21, 2:56 PM
Unknown Object (File)
Sat, Dec 21, 2:56 PM
Unknown Object (File)
Sat, Dec 21, 2:55 PM
Unknown Object (File)
Sat, Dec 21, 2:54 PM
Unknown Object (File)
Sun, Dec 15, 7:26 AM
Unknown Object (File)
Fri, Nov 29, 4:16 AM
Subscribers

Details

Summary

This addresses ENG-7677.

We want to prevent the user from dismissing RegistrationTerms during an ongoing registration request because otherwise, they can re-enter it and trigger a second registration request.

Depends on D11848

Test Plan
  1. I applied this patch, which adds a 10s wait before registration attempts, and forces keyserver auth to fail
  2. I then testing the behavior in the UI. See video below

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/account/registration/registration-terms.react.js
80

This prevents the user from going back. According to the React Navigation docs, it seems like it's only thing that should be necessary. But I found that without setting gestureEnabled the swipe-back would visibly complete, even though the screen would not technically dismiss, which led to an experience where I was looking at the prior screen but couldn't press anything or do anything.

I added headerLeft because I wanted to indicate to the user that going back was not possible at this time. I could probably have figured out a way to "disable" the button instead (ie. gray it out and prevent animation when pressed), but would be a bit more complicated, and I'm not sure it matters a ton.

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 30 2024, 12:58 PM
Harbormaster failed remote builds in B28610: Diff 39714!
native/flow-typed/npm/@react-navigation/core_v6.x.x.js
1376 ↗(On Diff #39715)

We used to use $Shape for these types, but then we switched to $Partial when $Shape was deprecated. It looks like $Partial only supports undefined (and not null), but React Navigation definitely allows null here, and treats it as "no headerLeft" (as opposed to undefined, which is treated as "default headerLeft").

This revision is now accepted and ready to land.May 1 2024, 11:46 AM
ashoat retitled this revision from [native] Prevent use from leaving RegistrationTerms during registration request to [native] Prevent user from leaving RegistrationTerms during registration request.May 1 2024, 3:09 PM