-
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 page not found appears for a second when user opens a thread #20076
Conversation
@marcochavezf @fedirjh One of you needs to 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] |
src/libs/actions/Report.js
Outdated
|
||
// If we open an exist report, but it is not present in Onyx yet, we should change the method to set for this report | ||
// and we need data to be available when we navigate to the chat page | ||
if (_.isEmpty(report)) { |
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.
if (_.isEmpty(report)) { | |
if (_.isEmpty(allReports[reportID])) { |
We can check directly , report
is not reused in this block
src/libs/actions/Report.js
Outdated
const report = allReports[reportID]; | ||
|
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.
const report = allReports[reportID]; |
We can get rid of this line and use an inline check
@fedirjh I updated. |
@dukenv0307 We have an issue with money requests threads , the Rel.mov |
@dukenv0307 I think the issue comes from this line , the IOU reports are not included in all reports App/src/libs/actions/Report.js Line 763 in 0813e2c
|
@fedirjh I think we could create a Lines 68 to 72 in 0813e2c
|
@dukenv0307 looks good to me , let's implement it. |
@fedirjh I updated, please help to check again. |
@dukenv0307 looks good, let's add |
@fedirjh updated |
@dukenv0307 could you please update the testing steps to make them more clear , you can check the main issue steps. |
@fedirjh The main issue test steps need to create a sub thread in a thread, but we can reproduce when user A opens a thread in main DM and user B opens it |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-06-03.at.6.19.41.AM.movMobile Web - ChromeChrome.loading.movMobile Web - SafariSafari.mp4DesktopScreen.Recording.2023-06-03.at.6.50.24.AM.moviOSIOS.mp4Androidandroid.loading.mov |
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.
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.
LGTM, thanks guys! 🚀
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by https://github.com/marcochavezf in version: 1.3.24-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.24-5 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.24-5 🚀
|
if (_.isEmpty(ReportUtils.getReport(reportID))) { | ||
optimisticReportData.onyxMethod = Onyx.METHOD.SET; | ||
optimisticReportData.value = { | ||
...optimisticReportData.value, | ||
reportID: reportID.toString(), | ||
}; | ||
} |
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.
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.
Investigating now
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.
@aldo-expensify It looks like setting the reportID
optimistically is the root cause of the other issue.
function getReport(reportID) { | ||
return allReports[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; | ||
} |
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.
This also causing crash if user is not authenticated yet, and does not have any value in onyx. Part of #20394
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.
Nice catch @alitoshmatov
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.
FYI this can still return null if the report key is present, but the report was deleted (set to null)
Details
Page not found appears for a second when user opens a thread
Fixed Issues
$ #19364
PROPOSAL: #19364 (comment)
Tests
Offline tests
Same above
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screencast.from.02-06-2023.23.44.32.webm
Mobile Web - Chrome
Record_2023-06-02-23-45-23.mp4
Mobile Web - Safari
Screen.Recording.2023-06-03.at.00.44.15.1.mp4
Desktop
Screen.Recording.2023-06-03.at.01.16.17.mp4
iOS
Screen.Recording.2023-06-03.at.01.11.58.mp4
Android
19364.mp4