-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tests well. Left little suggestion about the code.
There's some conflicts to resolve @arosiclair |
@amyevans updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
✋ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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 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