Closed kbecciv closed 11 months ago
Triggered auto assignment to @bfitzexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~01c67f584444b66580
Platforms
in OP are ✅)Triggered auto assignment to @puneetlath (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (External
)
The Merchant and Date pages within the "Split Bill" flow are accessible via deeplinks, even though they should only be accessible in the "Request Money (IOU)" flow.
Here in MoneyRequestConfirmationList component: We determine if the IOU type is a Request: https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/components/MoneyRequestConfirmationList.js#L189-L189 We disable the Date and the Merchant fields if the IOU type is not a Request: https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/components/MoneyRequestConfirmationList.js#L490-L490 https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/components/MoneyRequestConfirmationList.js#L500-L500 https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/components/MoneyRequestConfirmationList.js#L510-L510
However, when accessing the Merchant and Date pages via deeplinks, there isn't any condition to check the iouType
before rendering the pages.
The MoneyRequestMerchantPage and MoneyRequestDatePage components do not have a condition to check the iouType
and prevent rendering when the type is not "request". This oversight allows users to access these pages via deeplinks even when they shouldn't be accessible.
To address this issue, we should wrap the content of both the MoneyRequestMerchantPage and MoneyRequestDatePage components in the FullPageNotFoundView component when the iouType
is not "request".
import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView';
function MoneyRequestMerchantPage({iou, route}) {
const iouType = lodashGet(route, 'params.iouType', '');
return (
<FullPageNotFoundView shouldShow={iouType !== CONST.IOU.MONEY_REQUEST_TYPE.REQUEST}>
{/* Rest of the component's content */}
</FullPageNotFoundView>
);
}
function MoneyRequestDatePage({iou, route}) {
const iouType = lodashGet(route, 'params.iouType', '');
return (
<FullPageNotFoundView shouldShow={iouType !== CONST.IOU.MONEY_REQUEST_TYPE.REQUEST}>
{/* Rest of the component's content */}
</FullPageNotFoundView>
);
}
Reference from CONST: https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/CONST.ts#L1048-L1052
By making these changes, when a user tries to access the Merchant or Date pages with the iouType
"split" or "send" via deeplinks, they will be presented with a "Not Found" page, while the rest of the content remains wrapped and won't be displayed.
Result:
https://github.com/Expensify/App/assets/77965000/4d6138da-88ce-4ff6-9234-7ca79d64a220
An alternative solution would be to conditionally navigate the user back to the previous page or the main page of the application.
useEffect(() => {
// Add this condition to check if iouType is 'split' and navigate back
if (iouType !== CONST.IOU.MONEY_REQUEST_TYPE.REQUEST) {
Navigation.goBack();
return;
}
However, displaying a "Not Found" page provides a clearer indication to the user that the page they are trying to access is not available.
@ntdiary could you please review my proposal, thank you!
Seems @kbecciv forgot to post my proposal where I'm the reporter:
Date/Merchant is disabled for split, but still accessible with deeplink
We only disabled the MenuItem
for the split but didn't have the logic to goBack or prevent user from accessing the MoneyRequestDatePage
and MoneyRequestMerchantPage
when they create the split then access the merchant, date deeplink
https://github.com/Expensify/App/blob/c36ac0c98cf8a92a5b7136bbf090550cca5ea90c/src/components/MoneyRequestConfirmationList.js#L490
https://github.com/Expensify/App/blob/c36ac0c98cf8a92a5b7136bbf090550cca5ea90c/src/components/MoneyRequestConfirmationList.js#L510
Create a new variable isTypeRequest
.
const isTypeRequest = iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST;
Update our useEffect
to goBack when our request is not money request.
if (!isDistanceRequest && (_.isEmpty(iou.participants) || (iou.amount === 0 && !iou.receiptPath) || shouldReset || !isTypeRequest)) {
Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID), true);
}
We can do it similar to other pages like merchant, distance.
We can also wrap our view with FullScreenNotFound when the request is not money request.
N/A
Date/Merchant is disabled for split, but still accessible with deeplink
We don't have the disable logic on the merchant and date page.
Instead of not showing the whole page, we can just disable the TextInput
here:
https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/pages/iou/MoneyRequestMerchantPage.js#L110-L119
by passing the disabled
prop or making the editable
prop false if iouType is SPLIT
or DISTANCE
editable={iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST}
This gives the impression, that the (merchant even though it exists) is uneditable.
We can only edit the TextInput via the picker, but we currently don't have the mechanism to disable showing the picker.
We can add this by adding an optional showPicker
prop to the NewDatePicker
component:
https://github.com/Expensify/App/blob/76c1559fb3fbee1d07c8f210b522b63edd03920e/src/pages/iou/MoneyRequestDatePage.js#L100-L104
The picker below textinput will not show if we want the date TextInput to be uneditable. (Making datePicker uneditable is a useful functionality that the component is missing)
These changes will result in us showing the default and uneditable values for deeplinked merchant and date pages.
xx
Proposal by: @hungvu193 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694749185834509
Date/Merchant is disabled for split, but still accessible with deeplink
We only disabled the MenuItem
for the split but didn't have the logic to goBack or prevent user from accessing the MoneyRequestDatePage
and MoneyRequestMerchantPage
when they create the split then access the merchant, date deeplink
https://github.com/Expensify/App/blob/c36ac0c98cf8a92a5b7136bbf090550cca5ea90c/src/components/MoneyRequestConfirmationList.js#L490
https://github.com/Expensify/App/blob/c36ac0c98cf8a92a5b7136bbf090550cca5ea90c/src/components/MoneyRequestConfirmationList.js#L510
Create a new variable isTypeRequest
.
const isTypeRequest = iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST;
Update our useEffect
to goBack when our request is not money request.
if (!isDistanceRequest && (_.isEmpty(iou.participants) || (iou.amount === 0 && !iou.receiptPath) || shouldReset || !isTypeRequest)) {
Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID), true);
}
We can do it similar to other pages like merchant, distance.
We can also wrap our view with FullScreenNotFound when the request is not money request.
N/A
A couple of proposals for you to review when you get a chance @ntdiary
will review soon. : )
@bfitzexpensify, personally, I think it's okay to display "it's not here" if the page is not accessible (i.e., @rayane-djouah's proposal). Do we need to confirm this expected result with the design team again?
@ntdiary yes, I think we have a well-established principle of using the "it's not here" page when a link is incorrect, so that should be fine here too
We're having a bit of a discussion in this thread about a broader solution to the issue of using a direct link to go to a specific page on a form that you shouldn't be able to access without filling in prior info: https://expensify.slack.com/archives/C049HHMV9SM/p1695064187785649?thread_ts=1694439235.983099&cid=C049HHMV9SM
Nice. Looks like that thread ended without a solid conclusion, so bumped Tienifr to move their proposal forward to get a consensus. Once that's reached, I'll come back here to clarify the expected behaviour for this issue
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
We're still figuring out in https://expensify.slack.com/archives/C01GTK53T8Q/p1695209109095579 if we can standardize on a single form of UX
Same update
@ntdiary @bfitzexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@ntdiary, @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
Bumped that thread again
@ntdiary @bfitzexpensify 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!
@ntdiary, @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
OK, from that thread, it sounds like there's general buy-in to go with this approach:
create a useScreenGuard(validationRule, fallbackScreen) hook. This will also use the same props and Onyx data available to the page to validate.
Essentially, the idea is that if you deep link to page 2 but page 1 isn’t filled, we'll fall back on page 1
@tienifr as the author of that proposal, does that sound correct?
Bump on the above @tienifr
OK, so we'll want to use a similar approach as shared by @tienifr in https://github.com/Expensify/App/issues/27572#issuecomment-1756999099. I'm guessing we'll need proposals rewritten given that context @ntdiary?
@ntdiary @bfitzexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @ntdiary is eligible for the Internal assigner, not assigning anyone new.
OK, so we'll want to use a similar approach as shared by @tienifr in #27572 (comment). I'm guessing we'll need proposals rewritten given that context @ntdiary?
This has not been fully confirmed in Slack yet
@ntdiary, @bfitzexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@ntdiary just seeing your latest comment in that Slack thread - do you feel we have enough of a consensus to move forward with a particular approach?
@bfitzexpensify, wow, I just realized we are also planning to refactor the money request flow (the PR #28618 @tgolen mentioned in that slack thread). And I don't think this issue is very critical and urgent, so it should also be fine to put this on hold for issue #26538. 🙂
Cool - updating title. I agree this isn't an urgent issue. Going to move this to weekly to match that holding issue
Still holding on https://github.com/Expensify/App/issues/26538 - though that itself has been taken off hold now, which is good
PR being reviewed in the holding issue, we're closing to testing this again
Testing about to start on that PR in the holding issue
still held
Still on hold, that issue is moving
With the refactor, this is no longer happening. Closing this out.
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:
/split/new/confirmation/
to/split/new/date/
or/split/new/merchant/
Expected Result:
Merchant and Date shouldn't be accessible through deeplink
Actual Result:
Merchant and Date are accessible through deeplink
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.70.5 Reproducible in staging?: y Reproducible in production?: y 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
https://github.com/Expensify/App/assets/93399543/875654cc-1a74-4e9c-a816-2cc736900fb9
https://github.com/Expensify/App/assets/93399543/5590bf53-9212-40a3-af8f-3f5a0eb2ee58
Expensify/Expensify Issue URL: Issue reported by: @hungvu193 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694749185834509
View all open jobs on GitHub
Upwork Automation - Do Not Edit