Page MenuHomePhabricator

[native] Introduce `StaffContextProvider`
ClosedPublic

Authored by atul on Oct 31 2022, 2:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 5:23 PM
Unknown Object (File)
Tue, Nov 26, 5:23 PM
Unknown Object (File)
Tue, Nov 26, 5:23 PM
Unknown Object (File)
Mon, Nov 25, 10:25 AM
Unknown Object (File)
Mon, Nov 25, 8:30 AM
Unknown Object (File)
Mon, Nov 25, 3:50 AM
Unknown Object (File)
Mon, Nov 25, 3:50 AM
Unknown Object (File)
Mon, Nov 25, 3:50 AM
Subscribers

Details

Summary

Context: https://linear.app/comm/issue/ENG-2134/have-a-flag-that-indicates-whether-the-build-is-a-staff-release

We want to maintain a staffUserHasBeenLoggedIn value so we know if a staff member is currently, or has previously logged in.

This provider will set staffUserHasBeenLoggedIn to true, but won't do the reverse. Once it's been set to true it will remain true indefinitely.

Test Plan
  1. Log value of provider
  2. Log into non-staff account
  3. Ensure that staffUserHasBeenLoggedIn is false
  4. Log into a staff account
  5. Ensure that staffUserHasBeenLoggedIn is true
  6. Log back into a non-staff account
  7. Ensure that staffUserHasBeenLoggedIn is still true

95828c.png (858×1 px, 361 KB)

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D5513 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Oct 31 2022, 2:14 PM

Added @ashoat as blocking since he has context, feel free to resign if you don't think it makes sense to be first-pass reviewer

Add StaffContextProvider to root.react.js

No point in making this a separate diff

Was thinking about this more, and I think it would useful if the "button" in LoggedOutModal actually showed an Alert when pressed (similar thing could be done in "Build info") that explained eg.:

Advanced logging enabled
Since a staff user was logged in earlier, advanced logging is still enabled. To disable, kill the app and reopen.

OR:

Advanced logging enabled
Since this is a debug build, advanced logged is enabled.

OR:

Advanced logging enabled
Since this is a beta build, advanced logged is enabled.

In order to figure out which message we should display, we'd want to know which of the scenarios apply. So perhaps we should expand the context here to include a bit more info?

Accepting since it's not a hard requirement and could be handled in a later diff.

This revision is now accepted and ready to land.Nov 1 2022, 5:24 AM

For the first message, if the user popped up the Alert from a logged-in state (BuildInfo) we'd actually want to say:

Advanced logging enabled
Since a staff user is logged in, advanced logging is enabled. To disable, log out and then kill the app and reopen.

Was thinking about this more, and I think it would useful if the "button" in LoggedOutModal actually showed an Alert when pressed (similar thing could be done in "Build info") that explained eg.:

Advanced logging enabled
Since a staff user was logged in earlier, advanced logging is still enabled. To disable, kill the app and reopen.

OR:

Advanced logging enabled
Since this is a debug build, advanced logged is enabled.

OR:

Advanced logging enabled
Since this is a beta build, advanced logged is enabled.

In order to figure out which message we should display, we'd want to know which of the scenarios apply. So perhaps we should expand the context here to include a bit more info?

Accepting since it's not a hard requirement and could be handled in a later diff.

Thanks for speccing this out. I'll handle this after I add staffUserHasBeenLoggedInIndicator to the Build Info page of Profile tab.

Linear task: https://linear.app/comm/issue/ENG-2151/[native]-advanced-logging-modal

atul edited the test plan for this revision. (Show Details)

rebase before landing

This revision was landed with ongoing or failed builds.Nov 1 2022, 1:02 PM
This revision was automatically updated to reflect the committed changes.