-
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
[$500] Dev: Web - Console error occurs when clicking on a deleted or paid request money category URL #28318
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01d64fca889407111a |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Dev: Web - Console error occurs when clicking on a deleted or paid request money category URL What is the root cause of that problem?We're checking for update here to dismiss the modal when a request is deleted or paid. App/src/pages/EditRequestPage.js Lines 109 to 114 in cf9ad20
However in the meantime while navigate is ready, we still can render other pages before our However it took 300ms for this timeout to be called, but the view is already unmounted due to our App/src/components/OptionsSelector/BaseOptionsSelector.js Lines 71 to 75 in cf9ad20
What changes do you think we should make in order to solve the problem?
And clear it in our componentWillUnmount function. We can also do similar thing with this block of code
const isCurrentRequestSettled = isSettled && (isAdmin || isRequestor);
useEffect(() => {
if (!isCurrentRequestSettled) {
return;
}
Navigation.isNavigationReady().then(() => {
Navigation.dismissModal(report.reportID);
});
}, [isCurrentRequestSettled]);
if (canEdit && fieldToEdit === CONST.EDIT_REQUEST_FIELD.DESCRIPTION) {
return (
<EditRequestDescriptionPage />
);
} Or we can just early return the FullPageNotFoundView page with the What alternative solutions did you explore? (Optional)In our if (!canEdit) {
return <FullPageNotFoundView shouldShow />;
} or we just return null if we can't edit the route: if (!canEdit) {
return null;
} |
ProposalPlease re-state the problem that we are trying to solve in this issue.Getting error while editing category of deleted request. What is the root cause of that problem?App/src/components/OptionRow.js Line 218 in cf9ad20
Here this.props.option.icons is undefined which causes the error. What changes do you think we should make in order to solve the problem?We can have default value as 0 if Here this.props.option.icons is undefined What alternative solutions did you explore? (Optional)N/A |
Proposal Please re-state the problem that we are trying to solve in this issue. Getting error while editing category of deleted request. What is the root cause of that problem?
App/src/components/OptionsSelector/BaseOptionsSelector.js
What changes do you think we should make in order to solve the problem? Ref cycle should be initialised properly and should not rely on timeouts assuming that element will be accessible by the time timeout is fulfilled. The timeout execution depends on the amount of asynchronous code running in EventLoop already. What alternative solutions did you explore? (Optional) Early return in EditRequestPage instead of returning FullPageNotFound at the end can help also, but this is a hack to bypass the issue instead of fixing it |
📣 @Youhy! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Thanks @hungvu193 for the proposal, it seems that we have the clear logic for the timeout in the App/src/components/OptionsSelector/BaseOptionsSelector.js Lines 135 to 137 in cf9ad20
Happy to move forward with @hungvu193's proposal as it fixes the root cause. 🎀 👀 🎀 C+ reviewed Thanks, @Youhy for the proposal, clearing the timeout is the ideal solution for this case. |
Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
cc @iwiznia Seems like we haven’t assigned a BZ member for this bug. |
A couple questions:
|
|
It will simply be a reference that holds the timeout ID. We will use this reference to clear the timeout when the component unmounts. We already have the clear logic in this line this.focusTimeout = setTimeout(...)
Yes, that is expected. We didn't clear the timeout, and it will be executed after the component unmounts. Consequently, the input reference will be null at that time. So, it's ideal to clear the timeout rather than adding a safety check.
Yes, that is currently the behavior. Should we consider updating it to display a "not found" view? |
Thanks for clarifying! And yes, I think having a link that does absolutely nothing is as broken as the current behavior from a user perspective. |
So do we need to show the Not found page in this case? |
Triggered auto assignment to @greg-schroeder ( |
Bug0 Triage Checklist (Main S/O)
|
I think we should, @greg-schroeder what do you think? |
We should definitely not have a link that does nothing - that's just the same buggy user experienced repackaged. I think we should show the not found page for sure |
Seems the slack discussion ended with: "So if the user that submitted the request visits the edit page of a settled request, they would land (or get redirected) to the request page with all fields disabled" |
Cool. Update my proposal to match the expected result:
ResultScreen.Recording.2023-10-17.at.22.22.12.mov |
@iwiznia @greg-schroeder @fedirjh this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
Let's hold until #29101 is merged. |
Looks like #29101 is now merged |
now merchant and description can be updated when a request is paid, is this expected? |
What do you think @fedirjh? |
This is the expected behavior:
@greg-schroeder Let's remove the hold. I am not sure what we will be fixing in this issue. Another PR fixed the original issue that was reported. So I think we should just close this issue. |
When clicking edit date deeplink still nothing happens. Isn't that we're fixing in this issue? |
@hungvu193 As per this thread: https://expensify.slack.com/archives/C01GTK53T8Q/p1697137352110949?thread_ts=1697134708.508379&cid=C01GTK53T8Q , I think that's expected behavior. |
Removed hold, sorry for delay I missed this one |
I think we should just close this after reviewing more. Please comment if you disagree. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
No console error should appear when clicking on the URL for a deleted or paid request money category
Actual Result:
A console error occurs when clicking on a deleted or paid request money category URL
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: Dev 1.3.74-2
Reproducible in staging?: n
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
screen-recording-2023-09-26-at-122150-pm_MBRPYdoK.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695713591802959
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: