You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-01-28] CRITICAL: [$500] Switching from most recent to #focus shows already-read chats in the LHN #34466
changed the title [-]Switching from most recent to #focus shows already-read chats in the LHN[/-][+][$500] Switching from most recent to #focus shows already-read chats in the LHN[/+]on Jan 12, 2024
// We need to update existing reports only once while loading because they are updated several times during loading and causes this regression: https://github.com/Expensify/App/issues/24596#issuecomment-1681679531
// However, if the user is offline, we need to update the reports unconditionally, since the loading of report data might be stuck in this case.
It will first compare with the existing list whether something has changed or not, then, we will only get the updated list IF the app is not loading (!isLoading).
But this problem arose again because, in #33530, we are adding a new property called finallyData that we haven't included the case yet for the onyx update ignore fix.
What changes do you think we should make in order to solve the problem?
We should include finallyData to be processed even when the onyx updates from the server haven't changed.
But another thing I notice with this switching mode is that the list could be late to be updated because we ignore the updates if isLoading is true which I think makes sense when we load the app for the first time because we want to wait for the OpenApp API to be fully complete first.
However, this becomes a problem when we switch from focus to most recent because it will also call OpenApp, so if we switch from focus -> most recent -> focus, we will see all read chats in the 2nd focus mode for a few seconds before the OpenApp completes.
Screen.Recording.2024-01-13.at.15.50.52.mov
We can fix this by adding another condition that checks if the priority mode is updated, then we will update the list.
const prevPriorityMode = usePrevious(priorityMode)
if (... || (prevPriorityMode !== priorityMode))
// update the list
}
@parasharrajat I'm trying to figure out whether the PR that caused this is right. #34466 was discovered in v1.4.24-7 and the deploy blocker slack thread shows it in production. #33530 was deployed to staging in 1.4.24-4, to production in 1.4.24-8. Are you sure that's the right one?
Hmm, I was also a little confused by this. I tried to pinpoint the PR where I finallyData was added. IMO, PR should have similarly handled the other cases like they were done for successData or failureData.
It might be possible that logic related to this issue was refactored later in some other PR which triggered this issue.
I could use some help here if we want to know the exact PR that made the bug noticeable.
So based on the solve, as well as this being a user (Expensify employee) reported bug, I think this may be one of those bugs that's been there pretty much since the beginning, we maybe just didn't notice it? We didn't appear to have regression tests that would catch it so it'll be unclear when it started.
That might be a cop out, though - I didn't investigate too long - but it feels like it might be the case
Yeah I think it's kind of a mix - the bug existed likely since the beginning, and then that linked PR could have fixed it but didn't since it didn't apply the onyx updates for finallydata
Activity
[-]Switching from most recent to #focus shows already-read chats in the LHN[/-][+][$500] Switching from most recent to #focus shows already-read chats in the LHN[/+]melvin-bot commentedon Jan 12, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0111ebc2af8eb5ed14
melvin-bot commentedon Jan 12, 2024
Triggered auto assignment to @zanyrenney (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 12, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)bernhardoj commentedon Jan 13, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Switching from the most recent fo #focus mode still shows all read chats
What is the root cause of that problem?
When we change the priority mode, it will recalculate the chats that should be shown on the LHN.
App/src/pages/home/sidebar/SidebarLinksData.js
Lines 75 to 88 in 753ce92
It will first compare with the existing list whether something has changed or not, then, we will only get the updated list IF the app is not loading (!isLoading).
However, we have an issue where the
isLoadingonyx data is stuck at true. This happened before because we are ignoring thesuccessDataandfailureDataif the onyx updates from the server haven't changed, then we fix it by making sure bothsuccessDataorfailureDatais always applied even when that case happen.But this problem arose again because, in #33530, we are adding a new property called
finallyDatathat we haven't included the case yet for the onyx update ignore fix.What changes do you think we should make in order to solve the problem?
We should include
finallyDatato be processed even when the onyx updates from the server haven't changed.App/src/libs/actions/OnyxUpdates.ts
Lines 87 to 95 in 753ce92
Another issue:
But another thing I notice with this switching mode is that the list could be late to be updated because we ignore the updates if
isLoadingis true which I think makes sense when we load the app for the first time because we want to wait for the OpenApp API to be fully complete first.App/src/pages/home/sidebar/SidebarLinksData.js
Lines 84 to 86 in 753ce92
However, this becomes a problem when we switch from focus to most recent because it will also call OpenApp, so if we switch from focus -> most recent -> focus, we will see all read chats in the 2nd focus mode for a few seconds before the OpenApp completes.
Screen.Recording.2024-01-13.at.15.50.52.mov
We can fix this by adding another condition that checks if the priority mode is updated, then we will update the list.
zanyrenney commentedon Jan 15, 2024
@parasharrajat please review the proposal and let me know what you think.
31 remaining items
garrettmknight commentedon Jan 24, 2024
@parasharrajat I'm trying to figure out whether the PR that caused this is right. #34466 was discovered in v1.4.24-7 and the deploy blocker slack thread shows it in production. #33530 was deployed to staging in 1.4.24-4, to production in 1.4.24-8. Are you sure that's the right one?
garrettmknight commentedon Jan 26, 2024
@parasharrajat bump on the above
parasharrajat commentedon Jan 29, 2024
Hmm, I was also a little confused by this. I tried to pinpoint the PR where I
finallyDatawas added. IMO, PR should have similarly handled the other cases like they were done for successData or failureData.It might be possible that logic related to this issue was refactored later in some other PR which triggered this issue.
I could use some help here if we want to know the exact PR that made the bug noticeable.
dangrous commentedon Jan 29, 2024
So based on the solve, as well as this being a user (Expensify employee) reported bug, I think this may be one of those bugs that's been there pretty much since the beginning, we maybe just didn't notice it? We didn't appear to have regression tests that would catch it so it'll be unclear when it started.
That might be a cop out, though - I didn't investigate too long - but it feels like it might be the case
dangrous commentedon Feb 1, 2024
let me know what you think of that ^ @garrettmknight and @parasharrajat.
parasharrajat commentedon Feb 1, 2024
It is possible. I think we are fine with the above-linked PR. IMO PR could have solved this issue if the finallyData case was implemented as well.
dangrous commentedon Feb 2, 2024
Yeah I think it's kind of a mix - the bug existed likely since the beginning, and then that linked PR could have fixed it but didn't since it didn't apply the onyx updates for finallydata
dangrous commentedon Feb 6, 2024
Following up on this @garrettmknight @zanyrenney should we investigate this further, or are we good to move forward on payment?
garrettmknight commentedon Feb 6, 2024
Hey @dangrous - no need to investigate further. We're good to pay out here.
dangrous commentedon Feb 7, 2024
Great! @zanyrenney we're ready to go here - thanks!
zanyrenney commentedon Feb 8, 2024
Thanks @danieldoglas
zanyrenney commentedon Feb 8, 2024
payment summary:
@parasharrajat requires payment through NewDot Manual Requests - please request $500 for this issue
@bernhardoj requires payment automatic offer (Contributor)**** paid $500 via upwork!
parasharrajat commentedon May 20, 2024
Payment requested as per #34466 (comment)
JmillsExpensify commentedon May 31, 2024
$500 approved for @parasharrajat