Skip to content

[HOLD for payment 2024-11-28] Create expense button on empty Search page allows to create expense for non-migrated users #52457

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.0.61-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was repro when executing this PR: #51979
Email or phone of affected tester (no customers): sjidojsodsdjo@gmail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.expensify.com/inbox
  2. Sign in with a new Gmail account.
  3. Create a Control workspace (not Collect).
  4. Log in to staging.new.expensify.com with the same account.
  5. Click FAB > Create submit (or any expense option).
  6. Note that it shows Coming soon modal.
  7. Go to Search.
  8. Click Create expense on the empty state modal.

Expected Result:

Create expense button on the empty Search page will open Coming soon modal.

Actual Result:

Create expense button on the empty Search page allows user to create expense.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6663486_1731485882451.20241113_161233.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @adelekennedy / @adelekennedy

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 13, 2024
  2. melvin-bot commented on Nov 13, 2024

    @melvin-bot

    Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. melvin-bot commented on Nov 13, 2024

    @melvin-bot

    Triggered auto assignment to @MariaHCD (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Nov 13, 2024

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Nov 13, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. NJ-2020 commented on Nov 13, 2024

    @NJ-2020
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    What is the root cause of that problem?

    Offending PR: #51979

    Inside FAB we check if we should redirect the user to Expensify classic then we will not allow the user to create expense an show a modal

    text: translate('iou.createExpense'),
    shouldCallAfterModalHide: shouldRedirectToExpensifyClassic,
    onSelected: () =>
    interceptAnonymousUser(() => {
    if (shouldRedirectToExpensifyClassic) {
    setModalVisible(true);
    return;
    }

    But inside search page we did not handle that if the user should redirect to Expensify classic
    buttonText: translate('iou.createExpense'),
    buttonAction: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.TYPE.CREATE, ReportUtils.generateReportID())),
    success: true,

    What changes do you think we should make in order to solve the problem?

    We should handle the same way as we do inside FAB

    type PolicySelector = Pick<OnyxTypes.Policy, 'type' | 'role' | 'isPolicyExpenseChatEnabled' | 'pendingAction' | 'avatarURL' | 'name' | 'id' | 'areInvoicesEnabled'>;
    
    const policySelector = (policy: OnyxEntry<OnyxTypes.Policy>): PolicySelector =>
        (policy && {
            type: policy.type,
            role: policy.role,
            id: policy.id,
            isPolicyExpenseChatEnabled: policy.isPolicyExpenseChatEnabled,
            pendingAction: policy.pendingAction,
            avatarURL: policy.avatarURL,
            name: policy.name,
            areInvoicesEnabled: policy.areInvoicesEnabled,
        }) as PolicySelector;
    
    function EmptySearchView({type}: EmptySearchViewProps) {
        ...
        const [modalVisible, setModalVisible] = useState(false);
    
        const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector)});
    
        const shouldRedirectToExpensifyClassic = useMemo(() => {
            const groupPolicies = Object.values(allPolicies ?? {}).filter((policy) => ReportUtils.isGroupPolicy(policy?.type ?? ''));
            if (groupPolicies.length === 0) {
                return false;
            }
            return !groupPolicies.some((policy) => !!policy?.isPolicyExpenseChatEnabled);
        }, [allPolicies]);
    
        const content = useMemo(() => {
            switch (type) {
                ...
                buttons: [
                    {buttonText: translate('emptySearchView.takeATour'), buttonAction: () => Link.openExternalLink(navatticURL)},
                    {
                        buttonText: translate('iou.createExpense'),
                        buttonAction: () =>
                            interceptAnonymousUser(() => {
                                if (shouldRedirectToExpensifyClassic) {
                                    setModalVisible(true);
                                    return;
                                }
                                IOU.startMoneyRequest(CONST.IOU.TYPE.CREATE, ReportUtils.generateReportID());
                            }),
                        success: true,
                    },
                ],
        return (
            ...
            <ConfirmModal
                prompt={translate('sidebarScreen.redirectToExpensifyClassicModal.description')}
                isVisible={modalVisible}
                onConfirm={() => {
                    setModalVisible(false);
                    Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
                }}
                onCancel={() => setModalVisible(false)}
                title={translate('sidebarScreen.redirectToExpensifyClassicModal.title')}
                confirmText={translate('exitSurvey.goToExpensifyClassic')}
                cancelText={translate('common.cancel')}
            />
        )

    What alternative solutions did you explore? (Optional)

  7. MariaHCD commented on Nov 13, 2024

    @MariaHCD
    Contributor

    Clarifying in the main issue if the original contributor wants to take this over.

  8. MariaHCD commented on Nov 13, 2024

    @MariaHCD
    Contributor

    Looks like @ishpaul777 will take this over as a follow up to the PR that introduced this feature.

    Removing a deploy blocker label since this is a new feature.

  9. 22 remaining items

  10. melvin-bot commented on Dec 2, 2024

    @melvin-bot

    @puneetlath, @suneox, @adelekennedy, @ishpaul777 Eep! 4 days overdue now. Issues have feelings too...

  11. suneox commented on Dec 2, 2024

    @suneox
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other: A requirement for the new feature was missed in a case that wasn't considered.

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: I think there isn’t an offending PR here, as a case wasn’t considered in the description and this issue is a part of [HOLD for payment 2024-11-21] Re-direct to Classic when creating expenses for non-migrated users #51804

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
      N/A: It isn't an impactful bug

  12. puneetlath commented on Dec 5, 2024

    @puneetlath
    Contributor

    @adelekennedy looks like this is ready to pay?

  13. adelekennedy commented on Dec 6, 2024

    @adelekennedy
    Contributor
  14. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    📣 @creativedev814! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  15. RastogiNishant commented on Dec 6, 2024

    @RastogiNishant

    Contributor details
    Your Expensify account email: rastoginishant@yahoo.in
    Upwork Profile Link: https://www.upwork.com/freelancers/nishantvrastogi

  16. melvin-bot commented on Dec 6, 2024

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  17. suneox commented on Dec 6, 2024

    @suneox
    Contributor

    @adelekennedy Thank you! I’ve accepted an offer

  18. suneox commented on Dec 6, 2024

    @suneox
    Contributor

    @creativedev814, @RastogiNishant Welcome to Expensify! First, please take some time to read through the guidelines on how to contribute to this project. This will help you understand the process and expectations for contributing effectively.

  19. ishpaul777 commented on Dec 6, 2024

    @ishpaul777
    Contributor

    I have accepted offer! Thanks @adelekennedy 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions