[HOLD] Add offline feedback on settings pages - Reported by: @Santhosh-Sellavel
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Navigate to the settings page
- Kill the internet connection
- Navigate to any of the settings page and try changing content (Changing the password, changing the priority mode)
Expected Result:
There should be some kind of feedback to let the user know that the app is offline.
Actual Result:
There's no feedback that the app is offline. This is more noticeable on mobile apps where the only offline feedback can be seen when the user is on LHN/settings (via the offline dot on user avatar) and under the compose box in a conversation. This is happening in:
- Change Password
- Preferences
- Payments
- Profile
Workaround:
None needed. Going back online fixed the issue.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.1.9-1
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/44479856/138804783-a1054adb-3b65-4fff-9d0c-127b84cc845d.mp4
https://user-images.githubusercontent.com/44479856/138804533-9e55c876-4573-423f-b43d-97933793cc83.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Santhosh-Sellavel Slack conversation:
Triggered auto assignment to @bondydaa (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Hmm I'm actually unsure of how we'd want to handle "offline mode" for things like changing password. We do want an offline first approach with new dot but certain calls might actually want to be ignored like changing your password, since you might then change it on web if you're phone is offline for some reason.
I'm not actually sure here so going to post in engineering-chat.
got some insight here https://expensify.slack.com/archives/C03TQ48KC/p1635262815146900?thread_ts=1635262185.146600&cid=C03TQ48KC and agreement that for certain things we probably want to break our "offline first approach"
I'm not super up to date all what new dot offers but at the very least for Change Password it should be prevented in offline mode and show a message like "You cannot change your password while offline. Please try again while online".
this is probably fine for a contributor though maybe we want more guidance from someone more well versed with our overall offline first approach? I'll let the contrib management team decide.
Triggered auto assignment to @dylanexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
On it
- In
src/pages/settings/PasswordPage.jswe add method “withOnyx” to check current internet connection with prop “network” - When user try to change Password , this code in
handleChangePassword()function checks Internet connection and depend of this makes different actions:
if(this.props.network.isOffline){
Growl.show(translateLocal('profilePage.growlMessageOnError'), CONST.GROWL.ERROR, 3000);
} else {
changePassword(this.state.currentPassword, this.state.newPassword)
.then((response) => {
if (response.jsonCode === 200) {
Navigation.navigate(ROUTES.SETTINGS);
}
});
}
- In
src/components/AvatarWithImagePicker.jswe add method “withOnyx” to check current internet connection with prop “network” - When user try to change
Avatar,onPressfunction checks internet connection and if user is offline shows Growl popUp:
onPress={() => {
if(this.props.network.isOffline){
Growl.show(translateLocal('profilePage.growlMessageOnError'), CONST.GROWL.ERROR, 3000);
} else {
this.setState({isMenuVisible: true})
}
}
}
https://user-images.githubusercontent.com/71173662/139403527-1c01da24-d486-42ba-9edc-438457d902d5.MP4
https://user-images.githubusercontent.com/71173662/139403571-aeb466fe-2eb0-4979-92ef-96a43b9c5570.MP4
discussion occurring re: offline strategy
not overdue
@dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
not overdue
@dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
not overdue
not overdue
@dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
bringing up for convo
@dylanexpensify Hey ! can you give an update on our proposal? The situation is kind of unclear here. Maybe we need to fix/change something in proposal?
@developvsn According to the Contributor guide, as you are a new contributor, you are not allowed to work on multiple tasks at once. I saw that you are already working on two tasks simultaneously so I would suggest working on the requested changes for those. This also indicates that you have not gone through the contributor guidelines. Please read those and they will answer most of your questions regarding the process. With respect to these, there are code-style guides that will help you in PR reviews.
Bringing up for discussion today in channel
Still discussing internally, not overdue