-
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
fix: Incomplete reports would cause the app to crash on startup #2649
fix: Incomplete reports would cause the app to crash on startup #2649
Conversation
Added filtering so that only valid reports are processed by findLastAccessedReport Updated getInitialReport to getInitialReportScreenParams and moved to utils
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 but agree about putting the method back to the MainDrawerNavigator
Updated |
BTW I noticed that the Sidebar component uses Onyx to get the currently viewed report, while the Report Screen would use routing information These might need to be updated so they either use only nav routing or onyx. I think with the latest updates you can be sure that the data provided by navigation is accurate |
What exactly did you mean by this? It sort of makes sense that the report can use the routing since it's what sets the "current reportID in view" then anything else that needs to know about this can refer to that? But maybe you have some specific improvement in mind. |
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
The It's not really about improvement but about consistency you can get the it from Onyx or from navigation and right now we're doing both - We should not be doing the same thing in two different ways as it can be confusing |
I'd say consistency is a kind of improvement we value 🙃
I guess this is the part I'm curious about. Is there some way to access the route params via the navigation object? |
A screen would receive them naturally from props the way ReportScreen works I guess you might say "What about usages like in I don't think you need the reportID here - this would get resolved by initalParams, you can just redirect to HOME, or unmount the ValidateLogin screen Now the usage in So to cover both the above cases you can maybe capture reportID in Navigation and provide it / export it from there to everyone else Maybe there's an easier way... |
🚀 Deployed to staging in version: 1.0.34-5🚀
|
@kidroca @marcaaron Any QA needed for this PR? |
Mmmm I think we could rerun the previous PR? @marcaaron can you confirm this is ok? |
Yep re-running the previous PR sounds OK. However, it's not likely you'll run into the issue as we aren't sure what causes it and it should be fixed now. |
I am suspicious that this PR may have caused a regression |
Nevermind, doesn't seem like it did |
🚀 Deployed to production in version: 1.0.39-5🚀
|
@@ -85,3 +90,4 @@ export default compose( | |||
}, | |||
}), | |||
)(MainDrawerNavigator); | |||
export {getInitialReportScreenParams}; |
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.
Old PR now, but any idea why this export was added? Doesn't seem to be used anywhere AFAICT
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.
Maybe we were using it somewhere at some point. I don't really know tbh.
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.
Originally it was part of reportUtils
and imported to MainDrawerNavigator
: bc63c49#diff-82f2652821babb48b600a87486fa1191db7b3cc300845573a5757676e13cfc26L44
I decided it's tied to the MainDrawerNavigator (see _.once
decorator and description) and moved it for better context
I guess I used automatic refactoring, which preserves exporting the file after it's moved
<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>
@marcaaron
Added filtering so that only valid reports are processed by findLastAccessedReport
Updated getInitialReport to getInitialReportScreenParams and moved to utils
This is a follow up to address the issue found in #2575
Fixes #2497