-
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
Fix getContinuousReportActionChain with optimistic actions #41644
Conversation
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@parasharrajat can we get an ETA on the review for this? |
Had to merge main to get this fix, but that's on staging already. This tests well and makes sense |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safariweb.movMacOS: Desktop |
Fix getContinuousReportActionChain with optimistic actions (cherry picked from commit df96271)
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.70-5 🚀
|
Details
We previously only checked for optimistic actions at the start of the chat, but they can actually be anywhere. This makes sure that we do not consider them when building the continuous action chain since the backend does not know of them and previousReportActionID will be wrong.
If the result of
getContinuousReportActionChain
is wrong it will cause the same reportActionID to be sent toGetOlderActions
and cause this loading loop.Before
We incorrectly detect a gap in the actions list and return only the first action. Because of this we never detect that we are at the end of the chat and stop calling
GetOlderActions
.The first array is
sortedAllReportActions
and the 2nd isreportActions
which is the result of callinggetContinuousReportActionChain
.After
We properly skip over the optimistic action and return the full chat. This causes
GetOlderActions
to stop being called since we have the CREATED action.Fixed Issues
$ #41573
PROPOSAL: #41573 (comment)
Tests
GetOlderActions
is no longer called in a loop after this fixOffline tests
QA Steps
GetOlderActions
is no longer called in a loop after this fixPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop