Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a switch on dev and staging to force offline mode #12135
Add a switch on dev and staging to force offline mode #12135
Changes from 14 commits
075f04f
acabf93
5101892
587955a
294101e
2e8dea9
3b79301
036b718
d4f7f2d
70c5008
14bbfd8
b6db0a7
a16d31a
6ba03a9
db4ce83
a96133b
6fada1a
1bbe8ae
3608ff4
16802f0
2d1c45f
6d86036
41fa6c1
e4d0e3f
09007c1
3104a7e
5d44b69
a467667
7960bdc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine if we want to start with this - but I personally think this would be more useful if you could quickly switch to offline from anywhere. Maybe with a secret gesture or something. Having to navigate to the
/settings/preferences
screen and back to whatever you were doing before is not ideal.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the toggle is a good first step for now. I like the gesture idea, as long as its difficult to accidentally trigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking maybe 4 or 5 quick taps in a row?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in an ideal world, we could launch a PopOver containing the debug tools settings page.
As for how to launch this, 4-5 taps still seems too easy to accidentally trigger IMO. By any chance do we have a list of currently unused recognized gestures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Launching a Popover with the debug tools is a good idea, that way it's easy to observe the state of the settings.
To be clear we would only add this gesture on staging or dev, or maybe just on dev. I don't think there would be a huge consequence to triggering it if it just opens a popover. I really have no idea about gestures, I'll create an issue to add this and we can investigate there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a follow up issue https://github.com/Expensify/Expensify/issues/246352
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems like a good opportunity to just use the "real" value of the network and just let the sign in screen be not testable. If we were logged in before and had
shouldForceOffline
set to true then we'd be stuck in offline mode and couldn't log in to switch it off?If we want to be able to use "forced offline mode" on the sign in screen then we can do a more global switch that can be used from anywhere. The way we've done it here we can only set it on or off if we are logged in and looking at the
/settings/preferences
route. I think there's a chance QA will find this confusing and lock themselves out of the app 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exact purpose of this change is to prevent the user from being unable to sign in if they log out when shouldForceOffline is true.