[HOLD for payment 2021-12-06] The Android hardware back button does not minimise the app when pressed on the LHN/home screen
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:
- Click on an a chat from the LHN
- Once you're in the chat, press the back button to navigate back to the LHN/home screen
- From the LHN/home screen, press the back button again
Expected Result:
- When pressing the back button on the LHN/home screen, the app should be minimised (exited).
Actual Result:
- When pressing the back button on the LHN/home screen, we navigate back to the previous chat that users was in.
Workaround:
- None
Platform:
Where is this issue occurring?
- [ ] Web
- [ ] iOS
- [x] Android
- [ ] Desktop App
- [ ] Mobile Web
Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Upwork URL: https://www.upwork.com/jobs/~017e60e720f6f9aca8
Triggered auto assignment to @mallenexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
I don't have Android, trying to find someone on the CM team to triage
Assigning to @laurenreidexpensify for review since she has Android and I don't.
To me this is reproducible.
@kp17211 @parasharrajat I'm trying to reproduce this and a bit confused.
- Am on my Chats page
- tap into a chat
- within chat, tap top left hand < icon
- taken back to chat page
- swipe left as the generic Android "back" action
- am taken to the chat I was just in
Am I missing something? Isn't this the expected behaviour?
am taken to the chat I was just in
This is an issue.
the flow should be
- You click on any chat from LHN.
- It takes you to the chat.
- You click back button on android phone.
- It takes you back to chat list / LHN.
- You press the hardward back button again.
- App should minimize.
- But it will take you back to the recent open chat.
Ah got it - okay yes I can confirm this is the behaviour then. Will send this to our engineering team for next review.
Triggered auto assignment to @flodnv (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
I could've sworn this was a feature and not a bug (granted, that I found strange as well). What's the behavior on iOS?
What's the behavior on iOS?
I don't believe iOS has a "back" hardware button (at least most of their devices don't) so I think this only applies in Android.
I agree this should be fixed eventually, it's how most (if not all) Android apps work, so I'll take this over and making it External
Looks like these resources could be helpful:
- https://reactnative.dev/docs/backhandler
- https://reactnavigation.org/docs/custom-android-back-button-handling/
- Conversation in #expensify-open-source about using hooks here
Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
The title of this issue is a bit generic and the steps in the OP are a little confusing, so it would be good to spruce this up before posting to Upwork. Before I make the updates, am I right in thinking the issue here is isolated to: The Android hardware back button does not minimise the app when pressed on the LHN/home screen?
Then the Action Performed reproduction steps are:
- Click on an a chat from the LHN
- Once you're in the chat, press the back button to navigate back to the LHN/home screen
- From the LHN/home screen, press the back button again
Expected Results
- When pressing the back button on the LHN/home screen, the app should be minimised (exited).
Actual Results
- When pressing the back button on the LHN/home screen, we navigate back to the previous chat that users was in.
Let me know if that's correct and I'll update the issue. 👍 Also, not sure if it's helpful to reference for the implementation approach, but we had some wider inconsistencies with the Android back button a little while back here.
We should first look into React-navigation. It was previously fixed but after the upgrade of react-navigation to v6 broke that fix.
Nice @trjExpensify that looks like a great summary! 👍
Cool, updated. Upwork job is here. @kp17211 are you interested in applying seeing as though you raised this issue?
Hello @trjExpensify yes I want to work on this issue
@kp17211 I think what @trjExpensify was asking was if you want to submit a proposal for the fix :D
Not overdue, just waiting for proposals
Changing priority to weekly as we wait for proposals
@Beamanator I'm interested to work on the job. Submitted proposal at Upwork.