[No QA] Fix optimistic reports getting cleared by unnecessary OpenReport calls#37930
Conversation
|
@mananjadhav 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] |
|
This is ready for review however I did have trouble testing on mobile web and native since it's difficult to navigate back to the chat before the network call fails. I skipped those and just tested web and desktop but feel free to try. |
|
It seems that there's a race condition between the I'm not sure why this is suddenly an issue now and not before. Maybe the response from |
|
Alright new approach is detailed here. I've updated this PR to handle @mananjadhav this is ready for review. However, this needs to be deployed before the backend changes are deployed so that we do not start setting |
|
Okay thanks for the update. I'll get it reviewed. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeCleanShot.2024-03-20.at.21.05.27.mp4Android: mWeb ChromeCleanShot.2024-03-20.at.21.13.26.mp4iOS: NativeSimulator.Screen.Recording.-.iPhone.Xs.-.2024-03-20.at.20.50.23.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.Xs.-.2024-03-20.at.20.53.37.mp4MacOS: Chrome / SafariCleanShot.2024-03-20.at.20.31.24.mp4MacOS: DesktopCleanShot.2024-03-20.at.20.58.44.mp4 |
fedirjh
left a comment
There was a problem hiding this comment.
Looks good and tests well. Left little suggestion about the code.
|
There's some conflicts to resolve @arosiclair |
|
@amyevans updated! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/amyevans in version: 1.4.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
| export default function shouldFetchReport(report: Report) { | ||
| // If the report is optimistic, there's no need to fetch it. The original action should create it. | ||
| // If there is an error for creating the chat, there's no need to fetch it since it doesn't exist | ||
| return !report?.isOptimisticReport && !report?.errorFields?.createChat; |
There was a problem hiding this comment.
From #54512
we need to avoid the complications caused by passing and monitoring a complex object.



Details
Fixes issues with failed optimistic reports getting cleared immediately on reconnect. This prevents helpful error messages from being hidden.
Fixed Issues
$ #36928
PROPOSAL: #36928 (comment)
Tests
Non-existing report
No-access report
Offline tests
Same as Tests
QA Steps
None
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop