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
Unknown Object (File)
Wed, Oct 30, 12:08 PM
Unknown Object (File)
Fri, Oct 25, 11:36 PM
Unknown Object (File)
Tue, Oct 22, 1:47 AM
Unknown Object (File)
Mon, Oct 21, 9:48 PM
Unknown Object (File)
Mon, Oct 21, 9:59 AM
Unknown Object (File)
Mon, Oct 21, 6:58 AM
Unknown Object (File)
Sun, Oct 20, 7:09 AM
Unknown Object (File)
Tue, Oct 15, 11:58 PM
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 ↗(On Diff #39714)

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

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