Skip to content

[Due for payment 2025-04-30] [$250] Android - Empty workspace name for first workspace created in new account #59776

Closed

Description

@jponikarchuk

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.1.24-2
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Tecno spark 20/ Android 13
App Component: Workspace Settings

Action Performed:

  1. Open app
  2. Sign in with a new account
  3. Finish the onboarding flow
  4. Navigate to workspace > Create new workspace

Expected Result:

Confirm workspace page opens with a suggested workspace name

Actual Result:

Workspace name is empty in confirm page for new workspace in new account.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021912156454024432800
  • Upwork Job ID: 1912156454024432800
  • Last Price Increase: 2025-04-15
  • Automatic offers:
    • nkdengineer | Contributor | 106960682
Issue OwnerCurrent Issue Owner: @abekkala

Activity

  1. added
    Bug
    Daily
    on Apr 8, 2025
  2. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    Triggered auto assignment to @abekkala (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. nkdengineer commented on Apr 8, 2025

    @nkdengineer
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-08 05:06:24 UTC.

    Proposal

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

    Workspace name is empty in confirm page for new workspace in new account.

    What is the root cause of that problem?

    Here is the logic we used to get the default workspace name

    const emailParts = email ? email.split('@') : sessionEmail.split('@');
    if (!emailParts || emailParts.length !== 2) {
    return '';

    if email is empty, we will use sessionEmail.

    In native platform the currentUrl is empty, so the email is empty too.

    sessionEmail is also empty at this point because it hasn't been loaded yet.

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

    We should get the sessionEmail in WorkspaceConfirmationForm

        const [currentUserLogin, metadata] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.email});
    ...
        const defaultWorkspaceName = generateDefaultWorkspaceName(policyOwnerEmail || currentUserLogin);
    

    and render the input when metadata.status === 'loaded'

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Add ui test to verify the input has data when render WorkspaceConfirmationPage

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. added
    External
    on Apr 15, 2025
  5. changed the title [-]Android - Empty workspace name for first workspace created in new account[/-] [+][$250] Android - Empty workspace name for first workspace created in new account[/+] on Apr 15, 2025
  6. melvin-bot commented on Apr 15, 2025

    @melvin-bot
  7. added
    Help Wanted
    on Apr 15, 2025
  8. melvin-bot commented on Apr 15, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)

  9. nkdengineer commented on Apr 17, 2025

    @nkdengineer
    Contributor

    @jayeshmangwani Do you agree with my proposal above?

  10. huult commented on Apr 17, 2025

    @huult
    Contributor

    Proposal

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

    Empty workspace name for first workspace created in new account

    What is the root cause of that problem?

    In this case of the ticket, the policyOwnerEmail is empty because the data is not available from the URL on the non-native platform.

    const policyOwnerEmail = currentUrl ? new URL(currentUrl).searchParams.get('ownerEmail') ?? '' : '';

    const defaultWorkspaceName = generateDefaultWorkspaceName(policyOwnerEmail);

    and with that, we will use sessionEmail to generateDefaultWorkspaceName

    const emailParts = email ? email.split('@') : sessionEmail.split('@');

    But for the first time, the sessionEmail is empty because the value of sessionEmail is returned late, after generateDefaultWorkspaceName is called, causing generateDefaultWorkspaceName to be empty. sessionEmail is empty because Policy.ts has not been called to initialize, and the data is not ready to be used.

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

    To resolve this issue, we should initialize Policy.ts to ensure the callback from Onyx is ready, allowing the data to be available before being used inside a function/component.

    And a way to implement a fix for this issue, similar to the solution above, would look something like this:

    We call generateDefaultWorkspaceName in WorkspacesListPage to initialize sessionEmail before navigating to WorkspaceConfirmationPage

    onCtaPress={() => interceptAnonymousUser(() => Navigation.navigate(ROUTES.WORKSPACE_CONFIRMATION.getRoute(ROUTES.SETTINGS_WORKSPACES.route)))}

        onPress={() =>
            interceptAnonymousUser(() => {
                generateDefaultWorkspaceName();
                InteractionManager.runAfterInteractions(() => {
                    Navigation.navigate(ROUTES.WORKSPACE_CONFIRMATION.getRoute(ROUTES.SETTINGS_WORKSPACES.route));
                });
            })
        }

    or

        useEffect(() => {
            generateDefaultWorkspaceName();
        }, []);

    or

    we create empty function in side Policy.ts

    https://github.com/Expensify/App/blob/76442fc4b42c0156c0ae9cf5e40449fb923467ec/src/libs/actions/Policy/Policy.ts

      function initPolicys() {}

    and call it at WorkspacesListPage.tsx#L452 to init Policy

        useEffect(() => {
            initPolicys();
        }, []);
    Screen.Recording.2025-04-17.at.11.15.45.mp4

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  11. 18 remaining items

  12. melvin-bot commented on Apr 23, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on Apr 23, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.31-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 2025-04-30. 🎊

    For reference, here are some details about the assignees on this issue:

  14. melvin-bot commented on Apr 23, 2025

    @melvin-bot

    @jayeshmangwani @abekkala @jayeshmangwani The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. rlinoz commented on Apr 23, 2025

    @rlinoz
    Contributor

    Looking here #60473 (comment)

  16. added
    Daily
    and removed
    Weekly
    on Apr 30, 2025
  17. jayeshmangwani commented on Apr 30, 2025

    @jayeshmangwani
    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:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 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: feat: Provide education/confirmation before creating workspaces in New Workspace flows #53845 (comment)

    • [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: Not that CRITICAL

    • [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.

    Regression Test Proposal

    1. Open the app.
    2. Sign in using a new account.
    3. Complete the onboarding flow.
    4. Navigate to Workspace > Create New Workspace.
    5. Confirm that the workspace page opens and displays a suggested workspace name.

    Do we agree 👍 or 👎

  18. jayeshmangwani commented on Apr 30, 2025

    @jayeshmangwani
    Contributor

    Just a quick note regarding this comment: #59776 (comment), there was no regression. It’s possible the tester encountered an issue during testing, but the fix was verified in the next build by others.

  19. abekkala commented on Apr 30, 2025

    @abekkala
    Contributor

    @rlinoz can you confirm that was not actually considered a regression (affecting payout)?

  20. rlinoz commented on Apr 30, 2025

    @rlinoz
    Contributor

    Yep, no regression

  21. abekkala commented on Apr 30, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR APRIL 30

    • Fix: @nkdengineer [$250] payment sent and contract ended - thank you! 🎉

    • PR Review: @jayeshmangwani [$250] payment via NewDot - thank you! 🎉

  22. garrettmknight commented on May 2, 2025

    @garrettmknight
    Contributor

    $250 approved for @jayeshmangwani

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions