-
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
[HOLD for payment 2023-11-09] [$1000] Web - API OpenReport shows after switch away from the app and back #27887
Comments
Job added to Upwork: https://www.upwork.com/jobs/~014f1c0d7d7d757660 |
Triggered auto assignment to @garrettmknight ( |
Triggered auto assignment to @laurenreidexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.OpenReport API gets called after switching tabs What is the root cause of that problem?We are calling the OpenReport API if visibility changes. App/src/pages/home/ReportScreen.js Lines 263 to 280 in 94c07ea
What changes do you think we should make in order to solve the problem?Based upon the suggestions as per this comment Just need to either remove or comment the above code and its working fine. What changes do you think we should make in order to solve the problem?N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.OpenReport is called even when the report is already focused. What is the root cause of that problem?We are using the useFocusEffect to handle opening a report but this will run every time the repors gets back to view App/src/pages/home/ReportScreen.js Lines 263 to 280 in 94c07ea
And I think the What changes do you think we should make in order to solve the problem?I would suggest removing the call
What alternative solutions did you explore? (Optional)N/A |
Thank you @saranshbalyan-1234 and @abdel-h66 for your proposals. Both proposals correctly pointed out the LOC that will trigger the OpenReport API command when users switch tabs. But we haven't pointed out the reason why we have those LOCs in the beginning. Without clearing the reason, it will be easy to revert the fix for a bug/requirement that we would like to cover before. Could you please investigate deeper on that? Thanks |
Yes that's true @hoangzinh after digging deeper into the previous changes for that part of the code, I found a PR that fixed the following issue. Switching other app after receiving messages, message will be marked 'read' This means that the visibility change subscription serves as a guard against reading messages without actually seeing them so removing it will definitly break this. As this being said, the issue seemed to appear on mobile only because that's where the So that check fixes the report being opened without seeing it, but that doesn't stop the call on devices where the report is already open and visibitly changes. I found out that adding a third check
|
@hoangzinh the isuue is with the useLayoutEffect which is causing api to be called whenever screen is focused, App/src/pages/home/ReportScreen.js Lines 262 to 280 in 94c07ea
Instead useLayoutEffect we can keep this code in a useEffect which is solving the issue, tested and its working fine with useEffect |
moreover @abdel-h66 's proposed solution is not working if(isTopMostReportID) {
return;
} Thinking moving it to useEffect would make much sense |
I just double checked my solution @saranshbalyan-1234 and it seems working just fine 😅 do you have a specific use case where it didn't work I would like to check |
@abdel-h66, I don't think it's related to the issue #15634. This issue solved another problem on small screen devices, where the user is still on LHN but the App still marks unread messages as read (just in case you don't know what LHN stands for, please take a look at this doc https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#guide-on-acronyms-used-within-expensify-communication) So by introducing the third check as you mentioned
I just checked, your third check of |
@saranshbalyan-1234 I don't think it's related to |
after removing cache, my proposal did not work, my bad! |
@garrettmknight, @hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@abdel-h66 can you update your solution with @hoangzinh's feedback? |
Yes @garrettmknight I still didnt have time for a second look on this one, I will update here once I try something different |
📣 @saranshbalyan-1234 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@marcaaron sure will update it soon, Thank you for the offer |
PR raised, please check @hoangzinh @marcaaron |
creating a new PR due to conflicts, sorry for inconvienience |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-11-09. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Summarizing payments:
@hoangzinh can you get to the checklist when you get a chance |
BugZero Checklist:
|
Nice one, closing! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
NO api OpenReport shows after switch away and back
Actual Result:
API OpenReport shows after switch away and back
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.72.6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Recording.4659.mp4
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695079219960739
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: