Skip to content

[HOLD for payment 2023-05-16] [$1000] Adding spaces after workspace names causes a temporary loss of name position #18006

Closed

Description

@kavimuru

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:

  1. Go to Settings > Workspaces > General settings
  2. Enter spaces after workspace name

Expected Result:

Adding spaces after workspace names, the name must remain in the same position

Actual Result:

Adding spaces after workspace names causes a temporary loss of name position

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
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

2023-04-25.03-18-49.1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682416466951609

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b8861e605da12033
  • Upwork Job ID: 1651227961524355072
  • Last Price Increase: 2023-04-26

Activity

  1. added
    Daily
    Needs Reproduction
    Bug
    on Apr 26, 2023
  2. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. PrashantMangukiya commented on Apr 26, 2023

    @PrashantMangukiya
    Contributor

    Proposal

    Posting proposal early as per new guidelines

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

    When add some spaces during workspace name save, it will show workspace name at different position for few moment.

    What is the root cause of that problem?

    When we add space within workspace name and Save, It will call submit() function here.

    submit(values) {
    if (this.props.policy.isPolicyUpdating) {
    return;
    }
    const outputCurrency = values.currency;
    Policy.updateGeneralSettings(this.props.policy.id, values.name, outputCurrency);
    Keyboard.dismiss();
    Navigation.navigate(ROUTES.getWorkspaceInitialRoute(this.props.policy.id));
    }

    We can see at line 67 it is calling Policy.updateGeneralSettings() with values.name without trim.

    So Policy.updateGeneralSettings() api will set workspace name within optimisticData as shown in line 416

    So during Save it will show optimistic data that consist workspace name with space, and once api call finish it shows data from onyx that consist workspace name trimmed. So this is the root cause of the problem.

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

    We have to trim workspace name within submit() function while calling Policy.updateGeneralSettings() as shown below. It will solve the issue as shown in Results video.

    submit(values) {
        ...
        // Policy.updateGeneralSettings(this.props.policy.id, values.name, outputCurrency);  // *** Old Code
        Policy.updateGeneralSettings(this.props.policy.id, values.name.trim(), outputCurrency);  // *** Updated Code
       ...
    }

    What alternative solutions did you explore? (Optional)

    We can trim workspace name while showing within ui, but this is not good idea. It will not solve the root cause of the issue. Also while we display info within ui we do not trim anywhere in the app. So this is not a good solution. So I will not suggest it.

    Results
    18006.-Workspace.mov
  5. added
    External
    and removed
    Needs Reproduction
    on Apr 26, 2023
  6. changed the title [-]Adding spaces after workspace names causes a temporary loss of name position[/-] [+][$1000] Adding spaces after workspace names causes a temporary loss of name position[/+] on Apr 26, 2023
  7. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor
  8. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to @kadiealexander (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  9. MelvinBot commented on Apr 26, 2023

    @MelvinBot
    Contributor

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

  10. 34 remaining items

  11. abekkala commented on May 16, 2023

    @abekkala
    Contributor

    Sounds good @eVoloshchak if you want to get the checklist done today I can go from there!

  12. abekkala commented on May 17, 2023

    @abekkala
    Contributor

    @eVoloshchak can you work on the checklist above?

  13. PrashantMangukiya commented on May 18, 2023

    @PrashantMangukiya
    Contributor

    @abekkala Ping for Upwork.

  14. abekkala commented on May 22, 2023

    @abekkala
    Contributor

    @eVoloshchak I need the checklist completed above before payments can be made.
    @PrashantMangukiya the checklist needs to be done prior to payment.

  15. eVoloshchak commented on May 23, 2023

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Add workspace name validation in App #13978

    • 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: https://github.com/Expensify/App/pull/13978/files#r1202706937

    • A discussion in #expensify-bugs 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 sure an additional discussion is needed, this is a simple visual bug, this should have been caught during the review

    • Determine if we should create a regression test for this bug.
      Is it easy to test for this bug? Yes
      Is the bug related to an important user flow? No
      Is it an impactful bug? No

      This is an edge case not that many users will encounter in addition to having a very low impact. I don't think a regression test is necessary here

  16. abekkala commented on May 23, 2023

    @abekkala
    Contributor

    Offers have been sent!

  17. ayazhussain79 commented on May 23, 2023

    @ayazhussain79
    Contributor

    @abekkala Offer accepted

  18. PrashantMangukiya commented on May 23, 2023

    @PrashantMangukiya
    Contributor

    @abekkala It show me offer not available. Can you please send me offer again.
    Screenshot 2023-05-24 at 1 34 55 AM

  19. abekkala commented on May 23, 2023

    @abekkala
    Contributor

    @PrashantMangukiya @eVoloshchak It looks like Upwork just had a short downtime and your two offers didn't actually go through. I'll have to just sent you a new payment and I'll reference this GH number

  20. PrashantMangukiya commented on May 23, 2023

    @PrashantMangukiya
    Contributor

    @abekkala Offer accepted.

  21. abekkala commented on May 23, 2023

    @abekkala
    Contributor

    @ayazhussain79 and @PrashantMangukiya payment has been made and contract ended. Thank you! 🎉

  22. abekkala commented on May 24, 2023

    @abekkala
    Contributor

    @eVoloshchak payment has been made and contracted ended. Thank you! 🎉
    Closing!

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