Skip to content
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

[HOLD for payment 2023-05-05] [$1000] Workspace list sorting order breaks if the name starts with lower case alphabet #16925

Closed
6 tasks done
kavimuru opened this issue Apr 4, 2023 · 37 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Apr 4, 2023

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. Open the app
  2. Open settings
  3. Open workspaces
  4. Add new workspace with first letter as small

Expected Result:

App should either auto capitalize first letter or should sort alphabetically considering both workspaces with capital first letter and workspaces with small first letter

Actual Result:

Sorting breaks if workspace list has both names with capital first letter and small first letter

Workaround:

unknown

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: 1.2.94-0
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
Untitle1d

sorting.break.issue.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680598452709389

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01230caf1a05f03e9c
  • Upwork Job ID: 1648184589918076928
  • Last Price Increase: 2023-04-25
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 4, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 4, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Apr 7, 2023
@MelvinBot
Copy link

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

1 similar comment
@MelvinBot
Copy link

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

I think this is more accurately a feature. Going to post in the linked thread.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 12, 2023
@MelvinBot
Copy link

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

Based on the discussion in Slack, I'm going to add the external label and get this issue moving again. Many apologies for the delay!

@melvin-bot melvin-bot bot removed the Overdue label Apr 18, 2023
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Apr 18, 2023
@melvin-bot melvin-bot bot changed the title Workspace list sorting order breaks if the name starts with lower case alphabet [$1000] Workspace list sorting order breaks if the name starts with lower case alphabet Apr 18, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01230caf1a05f03e9c

@MelvinBot
Copy link

Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 18, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

Workspace list sorting order breaks if the name starts with lower case alphabet

What is the root cause of that problem?

We are sorting workspace by the original name

.sortBy(policy => policy.title)

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

We should change the workspace's name to lowercase before sorting like this

 .sortBy(policy => policy.title.toLowerCase())

Optional: For consistency, we also should update the same in here:

.sortBy(policy => policy.name)

What alternative solutions did you explore? (Optional)

NA

Result

Screen Shot 2023-04-05 at 16 16 07

@PrashantMangukiya
Copy link
Contributor

Proposal

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

Workspace list sorting order breaks if the name starts with lower case alphabet chars.

What is the root cause of that problem?

Workspace render via this code block

<ScrollView style={styles.flex1}>
{_.map(workspaces, (item, index) => this.getMenuItem(item, index))}
</ScrollView>

We can see at line 192 there is not any sorting done on workspace list. 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 sort workspace by title as shown below.

<ScrollView style={styles.flex1}> 
   {_.map(_.sortBy(workspaces, value => value.title.toLowerCase()), (item, index) => this.getMenuItem(item, index))}
</ScrollView> 

It will solve problem i.e. Sort workspace by title no matter capital or small letter in title. As shown in results.

What alternative solutions did you explore? (Optional)

None.

Results
Workspace.mov

@MelvinBot
Copy link

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

@Pujan92
Copy link
Contributor

Pujan92 commented Apr 18, 2023

Proposal

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

Workspaces list sorting order incorrectly which places the workspaces with a small first letter at the bottom

What is the root cause of that problem?

Currently, the sort which is applied to the workspaces list is case-sensitive which causes this issue.

.sortBy(policy => policy.title)

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

We should apply lowerCase(policy.title.toLowerCase()) to workspace title to make it case-insensitive while sorting the list.

.sortBy(policy => policy.title)

@MelvinBot
Copy link

@JmillsExpensify @madmax330 @eVoloshchak 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!

@melvin-bot melvin-bot bot added the Overdue label Apr 20, 2023
@madmax330
Copy link
Contributor

@eVoloshchak have you had a chance to look at the proposals? I think @dukenv0307's proposal is good, thoughts?

@melvin-bot melvin-bot bot removed the Overdue label Apr 20, 2023
@MelvinBot
Copy link

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 25, 2023
@MelvinBot
Copy link

📣 @dukenv0307 You have been assigned to this job by @madmax330!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dukenv0307
Copy link
Contributor

@eVoloshchak @madmax330 The PR is ready for review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 28, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Workspace list sorting order breaks if the name starts with lower case alphabet [HOLD for payment 2023-05-05] [$1000] Workspace list sorting order breaks if the name starts with lower case alphabet Apr 28, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 28, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.7-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 2023-05-05. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@JmillsExpensify
Copy link

Alright, with the PR on production, let's summarize where we're at for payments. This PR is eligible for a 50% bonus, so that means we have the following.

The Upwork link is here: https://www.upwork.com/jobs/~01230caf1a05f03e9c. @dukenv0307 would you mind applying or sharing your Upwork profile?

@JmillsExpensify
Copy link

Then @eVoloshchak let's get the BZ checklist kicked off ahead of the regression period passing. Thank you all!

@dukenv0307
Copy link
Contributor

@JmillsExpensify I've applied, thanks!

@eVoloshchak eVoloshchak mentioned this issue May 2, 2023
91 tasks
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Workspaces list #11784

  • 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: Workspaces list #11784 (comment)

  • 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: I dpn't think additionlal steps are needed, it's a standart practise we're using throughout the app, it was just missed during the initial implementation of WorkspacesListPage

  • 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? (For example, adding a bank account)

    No

    Is it an impactful bug?

    No

    I think the regression test isn't necessary in this case, the bug has a very low impact

@JmillsExpensify
Copy link

Thanks for all those. I agree with that and that a regression test doesn't seem necessary.

@JmillsExpensify
Copy link

Then all contributors have been hired at this point, so we're down to waiting for the regression period to end in a couple of days. I'll pay out the relevant bonuses when issuing final payment. Stay tuned until then!

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels May 4, 2023
@madmax330
Copy link
Contributor

Still waiting on payment

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@JmillsExpensify
Copy link

All contributors paid out and no regression test required. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants