-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Log in - "Continue" button remains initially active on the login page when logout of offline mode #13062
Comments
Triggered auto assignment to @slafortune ( |
@yuwenmemon is this something that will be an internal fix? |
I feel like we have run into a similar issue elsewhere. IIRC there was some discussion about whether the user should even be allowed to "log out" if they are offline. I think we could block them from taking this action and nobody would notice or care. |
Hmm, I feel like we should still let people log out when offline. Imagine you are on a public computer at a library and your internet goes out and you want to leave. You want to be able to clear your session out from that machine before heading out the door, right? |
Using a public computer to do anything financial is never a good idea 😄 But, lol yeah! It's not a bad argument at all. |
I'm not sure if this is worth fixing but I have figured out a way we could possibly do it. So the reason this happens is because when we sign out, we call So we render once after clearing and then render again after setting isOffline back to the previous state. Hence why we see the "blip". Two possible ways around this:
|
cc @MariaHCD and @neil-marcellini for your thoughts since you worked on things adjacent to this. |
This is a tricky one. I like the The other option would be to have a different UX on the sign in page. Instead of disabling the button when offline we could just show an error message after you click it, like "Unable to sign in because you appear to be offline". I think that's what we used to have. I like the first option better because it's consistent with our offline UX. |
Okay so then to formalize what I'm thinking we'd add a function clearWithDefaults(defaults) {
const keyStatesToPreserve = fastMerge(defaultKeyStates, defaults);
return getAllKeys()
.then((keys) => {
_.each(keys, (key) => {
const resetValue = lodashGet(keyStatesToPreserve, key, null);
cache.set(key, resetValue);
notifySubscribersOnNextTick(key, resetValue);
});
return Storage.clear();
});
} Although I would be curious for why we opted to use the |
I like your proposal here #13062 (comment) and that's even better if it can fix another issue. |
Maybe it would be good to get some consensus on it in Slack?
I think it's just the way we did it. Building some extra functionality into |
Sorry, just saw this now after putting the PRs in - I think considering the language bug that this is worth fixing now, and in hindsight did not take too much time to figure out and code up. |
@yuwenmemon, @slafortune Huh... This is 4 days overdue. Who can take care of this? |
@yuwenmemon, @slafortune 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Taking this out of review as we had to go back to the drawing board as per this thread: My initial thought is that while we wait for react-native-onyx to go to SQLite based, we could try using |
@yuwenmemon, @slafortune Huh... This is 4 days overdue. Who can take care of this? |
Looking for volunteers here - https://expensify.slack.com/archives/C01GTK53T8Q/p1672088280027649 |
Triggered auto assignment to @grgia ( |
Reapplying the engineering label based on the convo here - https://expensify.slack.com/archives/C01GTK53T8Q/p1672088280027649 |
I created a draft PR for this. I'm running into issues trying to get it tested locally though. I should be able to finish this up tomorrow 🤞 |
@tgolen would you like some help testing it? |
Thanks! I was able to finally get it tested locally (once I learned I had to remove the webpack cache to see the local changes to react-native-onyx). Feel free to jump in on a review of Expensify/react-native-onyx#219. It should be ready to go. I tested it out on all platforms and it seems to work pretty well. It at least doesn't crash iOS anymore :D |
@tgolen, @slafortune, @grgia Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Not overdue. This is fixed with Expensify/react-native-onyx#220 |
Looks like this was ^ is close to complete |
Yep, it's getting there! Should be ready to merge |
@tgolen, @slafortune, @grgia Whoops! This issue is 2 days overdue. Let's get this updated quick! |
This just got deployed to Prod, so I believe we can close this out! Even gave it a quick spin and it works like a charm 👍 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR
Action Performed:
Expected Result:
The "Continue" button should be inactive, there should be an inscription "You seem to be offline".
Actual Result:
"Continue" button remains initially active
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.32.1
Reproducible in staging?: Yes
Reproducible in production?: No
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug5837443_Recording__3092.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: