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
[$250] IOU - Web - Loading spinner appears under expense every time open the expense page #45227
Version Number: 9.0.6-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
Go to FAB> Submit expense> Complete the flow
Go to thread transaction page
Go back to request page ( switch chat if needed)
Expected Result:
There should be no loading spinner when open the request page
Actual Result:
Loading spinner appears under expense every time open the request page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@mallenexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Please re-state the problem that we are trying to solve in this issue.
Loading indicator shows when we go back from a thread of the last message of a chat.
What is the root cause of that problem?
When we open a thread of the last message of a chat, then go back usign the parent link (on the header), a ReadNewestAction request is called which will show the loading indicator.
// This function is a placeholder as the actual pagination is handled by visibleReportActions
if(!hasMoreCached){
isFirstLinkedActionRender.current=false;
fetchNewerAction(newestReportAction);
}
if(isFirstLinkedActionRender.current){
isFirstLinkedActionRender.current=false;
}
setCurrentReportActionID(firstReportActionID);
},
Before the linked PR, we have a hasNewestReportAction in the condition. hasNewestReportAction tells us whether the last report action in the list is the newest one or not. If it's the newest one, then we don't request for read newest action. But the PR removed it because of this issue, so the read newest action request is always triggered.
Removing hasNewestReportAction works, but incomplete. We still need to prevent the read newest action request if hasNewestReportAction is true, but we need to place it correctly. To know where to put it, we need to understand what the issue is about first that caused hasNewestReportAction to be removed. To summarize it:
The issue that I linked above is that, when we link to the last action/message, sending another message won't show in the chat list. That's because isFirstLinkedActionRender is "stuck" at true, so the report actions is sliced only up to the linked action.
The only way to make it false is to trigger handleReportActionPagination, but it's never triggered because hasNewestReportAction is already true (remember, we linked to the last action/message).
What changes do you think we should make in order to solve the problem?
The solution is to only request for read newest action if the hasNewestReportAction is false in here.
This way, handleReportActionPagination will still be called and set isFirstLinkedActionRender to false while preventing read newest action request to be fired.
changed the title [-]IOU - Web - Loading spinner appears under expense every time open the expense page[/-][+][$250] IOU - Web - Loading spinner appears under expense every time open the expense page[/+]on Jul 16, 2024
Contributor: @bernhardoj owed $250 via NewDot
Contributor+: @ishpaul777 paid $250 via Upwork
Thx @ishpaul777, can you fill out the BZ checklist plz?
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:
[@] The PR that introduced the bug has been identified. Link to the PR:
[@] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@] Determine if we should create a regression test for this bug.
[@] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@bz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: Not required
Determine if we should create a regression test for this bug. - Yes
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Regression Test Proposal
Steps:
Go to FAB> Submit expense> Complete the flow
Go to thread transaction page
Go back to request page.
Expected Result:
There should be no loading spinner when open the request page
Test steps 2:
copy link to comment in a report
visit the link.
Send a new message in report.
Expected Result:
No loading indicator at the bottom
Activity
melvin-bot commentedon Jul 11, 2024
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lanitochka17 commentedon Jul 11, 2024
@mallenexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
lanitochka17 commentedon Jul 11, 2024
We think that this bug might be related to #vip-vsp
bernhardoj commentedon Jul 11, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Loading indicator shows when we go back from a thread of the last message of a chat.
What is the root cause of that problem?
When we open a thread of the last message of a chat, then go back usign the parent link (on the header), a ReadNewestAction request is called which will show the loading indicator.
App/src/pages/home/report/ListBoundaryLoader.tsx
Lines 99 to 109 in 978b833
This happens after #39454. The read newest action request is triggered from this block.
App/src/pages/home/report/ReportActionsView.tsx
Lines 431 to 433 in 978b833
App/src/pages/home/report/ReportActionsView.tsx
Lines 297 to 308 in 978b833
Before the linked PR, we have a
hasNewestReportActionin the condition.hasNewestReportActiontells us whether the last report action in the list is the newest one or not. If it's the newest one, then we don't request for read newest action. But the PR removed it because of this issue, so the read newest action request is always triggered.Removing
hasNewestReportActionworks, but incomplete. We still need to prevent the read newest action request ifhasNewestReportActionis true, but we need to place it correctly. To know where to put it, we need to understand what the issue is about first that causedhasNewestReportActionto be removed. To summarize it:The issue that I linked above is that, when we link to the last action/message, sending another message won't show in the chat list. That's because
isFirstLinkedActionRenderis "stuck" attrue, so the report actions is sliced only up to the linked action.App/src/pages/home/report/ReportActionsView.tsx
Lines 251 to 255 in 978b833
The only way to make it
falseis to triggerhandleReportActionPagination, but it's never triggered becausehasNewestReportActionis already true (remember, we linked to the last action/message).What changes do you think we should make in order to solve the problem?
The solution is to only request for read newest action if the
hasNewestReportActionis false in here.App/src/pages/home/report/ReportActionsView.tsx
Lines 300 to 303 in 978b833
This way,
handleReportActionPaginationwill still be called and setisFirstLinkedActionRenderto false while preventing read newest action request to be fired.bernhardoj commentedon Jul 11, 2024
Added more explanation to the proposal
mallenexpensify commentedon Jul 12, 2024
@bernhardoj is this the loading spinner that's referenced in the OP?

bernhardoj commentedon Jul 12, 2024
I believe it's this one, the read new action loading indicator.
melvin-bot commentedon Jul 15, 2024
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jul 16, 2024
Job added to Upwork: https://www.upwork.com/jobs/~018c260c51c3955b65
[-]IOU - Web - Loading spinner appears under expense every time open the expense page[/-][+][$250] IOU - Web - Loading spinner appears under expense every time open the expense page[/+]39 remaining items
bernhardoj commentedon Aug 4, 2024
PR is ready
cc: @ishpaul777
ishpaul777 commentedon Aug 26, 2024
This is ready for payment! 🎉
mallenexpensify commentedon Aug 26, 2024
Contributor: @bernhardoj owed $250 via NewDot
Contributor+: @ishpaul777 paid $250 via Upwork
Thx @ishpaul777, can you fill out the BZ checklist plz?
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:
bernhardoj commentedon Aug 30, 2024
Requested in ND.
mallenexpensify commentedon Aug 30, 2024
Forgot to tag @bernhardoj in the payment summary, updated.
@ishpaul777 BZ checklist plzzzzzzzz
ishpaul777 commentedon Aug 30, 2024
On it, Sorry missed the ping before
ishpaul777 commentedon Aug 30, 2024
Regression Test Proposal
Steps:
Expected Result:
There should be no loading spinner when open the request page
Test steps 2:
Expected Result:
No loading indicator at the bottom
Do we agree 👍 or 👎 ?
mallenexpensify commentedon Aug 30, 2024
Thanks @ishpaul777 , closing, test case is here
ishpaul777 commentedon Sep 5, 2024
i think This is good to close ?
JmillsExpensify commentedon Sep 6, 2024
$250 approved for @bernhardoj