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-04-05] Android - Chat - When offline, if a user requests money and then deletes the message, the page keeps loading #38844
Version Number: 1.4.56.0 Reproducible in staging?: y Reproducible in production?: n If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/4447619 Issue reported by: Applause - Internal Team
Action Performed:
Launch app
Tap on a new 1:1 report
Go offline
Send a message
Delete the message
Note the message is striked and no skeleton loading in the page
Tap plus icon and request money
Complete the request money flow
Send a message
Delete the message
Now note the page behaviour
Expected Result:
When offline, after requesting money, if a user sends and deletes a message, the deleted message should be struck through, and the rest of the messages on the page should display without any issues.
Actual Result:
When offline, after requesting money, if a user sends and deletes a message, the deleted message is struck through. However, the above messages and the entire page keep loading, displaying a skeleton.
Workaround:
n/a
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
When testing on dev, this behavior is reproducible for me on web as well. @kbecciv can you confirm if this is specific to Android or a regression across all platforms?
and because we delete the first action, the pending action is updated to delete, so the endIndex value is 0.
What changes do you think we should make in order to solve the problem?
Based on this comment, the reason we check for pending action add is that the action doesn't have the previousReportActionID value yet which we rely on the BE to give us the value.
// 2. If the first condition fails, it then checks if the previous item has a pendingAction of 'add'.
// This additional check is to include recently sent messages that might not yet be part of the established sequence.
But as mentioned above, when deleting the message, the pending action value is overwritten. The cause of the issue is the same as this one where we rely on the pending action, but it's overwritten. To overcome the issue, we introduce a new property called isOptimisticAction.
So, the solution is to replace the pending action check with isOptimisticAction.
Sorry, we shouldn't replace it but rather add another check for isOptimisticAction.
What alternative solutions did you explore? (Optional)
Optimistically set previousReportActionID to a new action, but doesn't sound good because it's possible the action list is not in order when the app is still loading or while offline.
@bernhardoj I like your alternate solution better - it seems like optimistic actions could be seamlessly integrated into the chain by setting the previousReportActionID to be the ID of the newest action on a report whenever creating a new one optimistically.
When you open a chat that the report actions are not loaded yet (empty, 0 length). In this case, the first optimistic comment previousReportActionID would be empty
changed the title [-]Android - Chat - When offline, if a user requests money and then deletes the message, the page keeps loading[/-][+][HOLD for payment 2024-04-05] Android - Chat - When offline, if a user requests money and then deletes the message, the page keeps loading[/+]on Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
Activity
github-actions commentedon Mar 22, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Mar 22, 2024
Triggered auto assignment to @NikkiWines (
Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.kbecciv commentedon Mar 22, 2024
We think that this bug might be related to #vip-vsb
NikkiWines commentedon Mar 23, 2024
When testing on dev, this behavior is reproducible for me on web as well. @kbecciv can you confirm if this is specific to Android or a regression across all platforms?
NikkiWines commentedon Mar 23, 2024
I have a suspicion that this is tied to the changes added by #30269. It also seems like similar behavior to another existing blocker #38781.
@roryabraham looks like you have context for both the PR and the associated blocker, thoughts?
roryabraham commentedon Mar 23, 2024
Yeah, looks quite possibly like the same root cause. Let's CP and retest.
bernhardoj commentedon Mar 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The other messages disappear and the skeleton shows when deleting a message.
What is the root cause of that problem?
The other messages disappear because
getContinuousReportActionChainonly includes some of the messages.App/src/libs/ReportActionsUtils.ts
Lines 307 to 308 in 191d932
When calculating the
endIndex, we check whether the current actionpreviousReportActionIDis the same as the previous actionpreviousReportActionID.App/src/libs/ReportActionsUtils.ts
Lines 283 to 292 in 191d932
However, a newly optimistic added action doesn't have
previousReportActionIDyet, so the condition always fails.The initial value of
endIndex(andstartIndex) is calculated here by finding the index of the action that thependingActionvalue is notadd,App/src/libs/ReportActionsUtils.ts
Line 268 in 191d932
and because we delete the first action, the pending action is updated to delete, so the
endIndexvalue is 0.What changes do you think we should make in order to solve the problem?
Based on this comment, the reason we check for pending action add is that the action doesn't have the
previousReportActionIDvalue yet which we rely on the BE to give us the value.App/src/libs/ReportActionsUtils.ts
Lines 297 to 298 in 191d932
But as mentioned above, when deleting the message, the pending action value is overwritten. The cause of the issue is the same as this one where we rely on the pending action, but it's overwritten. To overcome the issue, we introduce a new property called
isOptimisticAction.So, the solution is to
replace the pending action check withisOptimisticAction.Sorry, we shouldn't replace it but rather add another check for
isOptimisticAction.App/src/libs/ReportActionsUtils.ts
Line 268 in 191d932
App/src/libs/ReportActionsUtils.ts
Line 301 in 191d932
What alternative solutions did you explore? (Optional)
Optimistically set
previousReportActionIDto a new action, but doesn't sound good because it's possible the action list is not in order when the app is still loading or while offline.bernhardoj commentedon Mar 23, 2024
The issue still happens, please check my proposal for the solution.
roryabraham commentedon Mar 23, 2024
@bernhardoj I like your alternate solution better - it seems like optimistic actions could be seamlessly integrated into the chain by setting the
previousReportActionIDto be the ID of the newest action on a report whenever creating a new one optimistically.roryabraham commentedon Mar 25, 2024
Not sure I'm following the concern here @bernhardoj
5 remaining items
roryabraham commentedon Mar 26, 2024
That's actually a very good point
roryabraham commentedon Mar 26, 2024
verified that this is fixed on staging, going to close it out now.
[-]Android - Chat - When offline, if a user requests money and then deletes the message, the page keeps loading[/-][+][HOLD for payment 2024-04-05] Android - Chat - When offline, if a user requests money and then deletes the message, the page keeps loading[/+]melvin-bot commentedon Mar 29, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊