-
Notifications
You must be signed in to change notification settings - Fork 3k
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: ensure composer not full size when onyx state missing #31602
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -128,7 +128,7 @@ const defaultProps = { | |||||
*/ | ||||||
function getReportID(route) { | ||||||
// // The reportID is used inside a collection key and should not be empty, as an empty reportID will result in the entire collection being returned. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This has been driving me nuts for weeks 😂 mind fixing it? It's also great that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, also... you could maybe update the comment to explain why the
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, that's right. Can you please add that to the comment so that others will understand that too? It's very subtle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||||||
return String(lodashGet(route, 'params.reportID', null)); | ||||||
return String(lodashGet(route, 'params.reportID') || 0); | ||||||
} | ||||||
|
||||||
function ReportScreen({ | ||||||
|
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.
Good additional fix but I am concerned this will cause another unexpected regression we don't know.
If route is falsy, it redirects to ROUTES.HOME as fallback which is fine.
Let's just fix OP here.
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.
It redirects after nav state hydration has already occurred here in the default report setter:
App/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.js
Lines 85 to 91 in 04b5fa4
I'm finding that just fixing the onyx key still leaves a flash that's too fast to catch on video, but it's observable if you try to repro with this branch. It isn't the composer size, so it's technically out of scope for this issue - happy to remove if you prefer. But resetting nav state twice, which only happens on wide screens loading the root domain with no path, is causing problems, we really shouldn't be doing it. It's covered in step 4 of the root cause in my proposal.
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.
The problem is a lot of UI conditionals hinge on whether there's a report id. When you load the root domain, the default report setter provides a report id, but then the deep link handler redirects, blowing up nav state and taking report id back to an empty string. This leaves a gap where various components are rendering when there's no report ID.
That happens earlier in the root cause before
getReportID()
fails to return"null"
, and is technically a more accurate root cause.getReportID()
handling empty report ids is just a backup to provide default values. Both fixes are accurate, and both are related. We're counting on a lot of default value handling across a lot of components to cover this, but there's no need for the double redirect in the first place.I'm pretty confident that not only will this not cause more bugs, it will likely fix some seemingly unrelated issues.
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.
I'd suggest to raise this in slack with clear repro step and video of the buggy behavior and let team make create new GH
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.
Alright, I'll update the PR.
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.
I appreciate you digging into this and trying to fix the problem. I agree that it would be great to handle that in a separately scoped issue and PR. That makes everything easier to review/test/revert.