-
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
[HOLD for payment 2022-11-09] [$250] App crashes when navigating to Room details, participants, and settings pages with account that doesn't have access #11982
Comments
Triggered auto assignment to @puneetlath ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
Current assignee @Beamanator is eligible for the External assigner, not assigning anyone new. |
ProposalThe issue occurred when the Solution export default function (WrappedComponent) {
const propTypes = {
/** The HOC takes an optional ref as a prop and passes it as a ref to the wrapped component.
* That way, if a ref is passed to a component wrapped in the HOC, the ref is a reference to the wrapped component, not the HOC. */
forwardedRef: PropTypes.func,
/** The report currently being looked at */
report: reportPropTypes,
};
const defaultProps = {
forwardedRef: () => {},
report: {},
};
const WithReport = (props) => {
if (_.isEmpty(props.report)) {
Navigation.dismissModal();
return;
}
const rest = _.omit(props, ['forwardedRef']);
return (
<WrappedComponent
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
ref={props.forwardedRef}
/>
);
};
WithReport.propTypes = propTypes;
WithReport.defaultProps = defaultProps;
WithReport.displayName = `withReport(${getComponentDisplayName(WrappedComponent)})`;
const withReport = React.forwardRef((props, ref) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<WithReport {...props} forwardedRef={ref} />
));
return withOnyx({
report: {
key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`,
},
})(withReport);
} diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js
index e76c29c72..43faf41eb 100644
--- a/src/pages/ReportDetailsPage.js
+++ b/src/pages/ReportDetailsPage.js
@@ -22,6 +22,7 @@ import MenuItem from '../components/MenuItem';
import Text from '../components/Text';
import CONST from '../CONST';
import reportPropTypes from './reportPropTypes';
+import withReport from './home/report/withReport';
const propTypes = {
...withLocalizePropTypes,
@@ -177,10 +178,8 @@ ReportDetailsPage.propTypes = propTypes;
export default compose(
withLocalize,
+ withReport,
withOnyx({
- report: {
- key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`,
- },
personalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS,
},
diff --git a/src/pages/ReportParticipantsPage.js b/src/pages/ReportParticipantsPage.js
index f66c0cbfd..8f8a27323 100755
--- a/src/pages/ReportParticipantsPage.js
+++ b/src/pages/ReportParticipantsPage.js
@@ -19,6 +19,7 @@ import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import compose from '../libs/compose';
import * as ReportUtils from '../libs/ReportUtils';
import reportPropTypes from './reportPropTypes';
+import withReport from './home/report/withReport';
const propTypes = {
/* Onyx Props */
@@ -113,12 +114,10 @@ ReportParticipantsPage.displayName = 'ReportParticipantsPage';
export default compose(
withLocalize,
+ withReport,
withOnyx({
personalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS,
},
- report: {
- key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`,
- },
}),
)(ReportParticipantsPage);
diff --git a/src/pages/ReportSettingsPage.js b/src/pages/ReportSettingsPage.js
index 52c1ec527..58df7da72 100644
--- a/src/pages/ReportSettingsPage.js
+++ b/src/pages/ReportSettingsPage.js
@@ -21,6 +21,7 @@ import Picker from '../components/Picker';
import * as ValidationUtils from '../libs/ValidationUtils';
import OfflineWithFeedback from '../components/OfflineWithFeedback';
import reportPropTypes from './reportPropTypes';
+import withReport from './home/report/withReport';
const propTypes = {
/** Route params */
@@ -243,10 +244,8 @@ ReportSettingsPage.propTypes = propTypes;
export default compose(
withLocalize,
+ withReport,
withOnyx({
- report: {
- key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`,
- },
policies: {
key: ONYXKEYS.COLLECTION.POLICY,
}, Result Screen.Recording.2022-10-19.at.21.57.05.mov |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
I am okay with @mollfpr's proposal here. I am just not sure if:
What do you think @Beamanator ? 🎀 👀 🎀 |
Honestly, I like this approach but we still need to update the code that throws an error because of the render call before we dismiss the modal.
I guess we can't do this because we want to make all code DRY. |
@puneetlath, @mananjadhav, @Beamanator Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@puneetlath, @mananjadhav, @Beamanator Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Interesting, honestly I like @mollfpr 's proposal, making an HOC and using that to check for a Report & pass it down, or navigate home if it doesn't exist. What are y'all's concerns with that approach? Also, what do we think about naming it something more useful? I kinda feel like |
@Beamanator Yeah, I kinda got a hard time naming stuff 😅
|
@mollfpr LOL yeah sometimes me too 😅 Cool I like your proposal, and @mananjadhav approved here so hiring! |
📣 @mollfpr You have been assigned to this job by @Beamanator! |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.22-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2022-11-09. 🎊 |
@sobitneupane @mananjadhav @mollfpr can you please apply to the Upwork job here: https://www.upwork.com/jobs/~018e89dfcc7471e60c |
@puneetlath Applied. |
Applied too |
@mananjadhav can you please help with the step of identifying the PR where this bug was introduced? |
@puneetlath I would say this bug existed since the inception of the creation of the components. For example, We're directly fetching the Do you need something specific here? |
That's perfect, thanks @mananjadhav! |
Thanks for pointing it out @aimane-chnaif I just did some investigation and we probably miss the fact that we should fetch the report data on the App/src/pages/home/ReportScreen.js Lines 165 to 176 in 599f1b9
App/src/pages/home/ReportScreen.js Lines 122 to 135 in 599f1b9
And also we need to update the App/src/pages/ReportDetailsPage.js Lines 60 to 96 in 599f1b9
@mananjadhav @puneetlath @Beamanator Let me know what action we need to do here since the expected result is done and the #12428 need more work. |
@puneetlath Yup will do it shortly, thanks! |
Let's hold the payment for this issue until I have reviewed the suspected regression. If this really caused #12428 then payment will be made after that is fixed. |
@puneetlath, @mananjadhav, @Beamanator, @mollfpr Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Seems like payment is still on hold, see related discussions in #12676 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Note: Navigating to the room participants page & settings page also cause the same error
Expected Result:
User is redirected to their home page
Actual Result:
"Uh-oh, something went wrong" message is shown
Workaround:
Yes they can refresh the page
Platform:
Where is this issue occurring?
Version Number: Current
Reproducible in staging?: Yes
Reproducible in production?: Unknown
Notes/Photos/Videos: #11849 (comment)
Issue reported by: @sobitneupane
Slack conversation: None
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: