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 2024-10-04][$250] [Search v2.3] - Default name in name field displays user/report ID instead of user/report name #49739

Closed
6 tasks done
lanitochka17 opened this issue Sep 25, 2024 · 27 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 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 25, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.40-0
Reproducible in staging?: Y
Reproducible in production?: N
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): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Search
  3. Click Filters
  4. Click To
  5. Select a user and save it
  6. Click Save search
  7. Click 3-dot menu next to the saved search
  8. Click Rename

Expected Result:

The default name in search name field will display user name instead of user ID

Actual Result:

The default name in search name field displays user ID instead of user name
The same goes for report ID when In filter is used for chat

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6615159_1727291077447.ID.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021839048305434680628
  • Upwork Job ID: 1839048305434680628
  • Last Price Increase: 2024-09-25
  • Automatic offers:
    • rayane-djouah | Reviewer | 104132486
    • Nodebrute | Contributor | 104132487
Issue OwnerCurrent Issue Owner: @rayane-djouah
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

Copy link
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.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-control

@Nodebrute
Copy link
Contributor

Nodebrute commented Sep 25, 2024

Edited by proposal-police: This proposal was edited at 2024-09-25 21:41:18 UTC.

Proposal

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

Default name in name field displays user/report ID instead of user/report name

What is the root cause of that problem?

Here we are using title to convert reportID/userID to their names

let title = item.name;
if (title === item.query) {
const jsonQuery = SearchUtils.buildSearchQueryJSON(item.query) ?? ({} as SearchQueryJSON);
title = SearchUtils.getSearchHeaderTitle(jsonQuery, personalDetails, cardList, reports, taxRates);
}

But here we are passing item.name without updating it
rightComponent: <SavedSearchItemThreeDotMenu menuItems={getOverflowMenu(item.name, Number(key), item.query)} />,

We then use this item.name here to navigate to rename page
Navigation.navigate(ROUTES.SEARCH_SAVED_SEARCH_RENAME.getRoute({name: itemName, jsonQuery: inputQuery}));

and Then, on the Rename page, we get this name from the route. Since we haven't passed the updated title, we’ll see userID/ReportID instead of their names.
function SavedSearchRenamePage({route}: {route: {params: {q: string; name: string}}}) {

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

We should pass title here instead of item.name

rightComponent: <SavedSearchItemThreeDotMenu menuItems={getOverflowMenu(item.name, Number(key), item.query)} />,
We should check for other places too where we have this issue

What alternative solutions did you explore? (Optional)

@daledah
Copy link
Contributor

daledah commented Sep 25, 2024

Proposal

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

The default name in search name field displays user ID instead of user name
The same goes for report ID when In filter is used for chat

What is the root cause of that problem?

Currently we are getting name directly from query when there is no name here

const {q, name} = route.params;
const [newName, setNewName] = useState(name);

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

We should convert from query to name like we did here

    useEffect(()=>{
        if(name === q){
            const jsonQuery = SearchUtils.buildSearchQueryJSON(q) ?? ({} as SearchQueryJSON);
            const title = SearchUtils.getSearchHeaderTitle(jsonQuery, personalDetails, cardList, reports, taxRates);
            setNewName(title)
        }
    },[name])

and need to update the default value to newName

  defaultValue={newName}

What alternative solutions did you explore? (Optional)

NA

@Nodebrute
Copy link
Contributor

Proposal Updated
Fixed link previews

@neonbhai
Copy link
Contributor

neonbhai commented Sep 25, 2024

Proposal

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

Default name in name field displays user/report ID instead of user/report name

What is the root cause of that problem?

We don't pass the updated item title for getOverflowMenu here:

rightComponent: <SavedSearchItemThreeDotMenu menuItems={getOverflowMenu(item.name, Number(key), item.query)} />,

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

We should pass the updated title to :

rightComponent: <SavedSearchItemThreeDotMenu menuItems={getOverflowMenu(title, Number(key), item.query)} />,\

Note: This bug does not occur for small screen devices as we pass it correctly here.

Result

This works perfectly:

Screen.Recording.2024-09-26.at.1.50.57.AM.mov

@stitesExpensify stitesExpensify added the External Added to denote the issue can be worked on by a contributor label Sep 25, 2024
@melvin-bot melvin-bot bot changed the title Save search - Default name in name field displays user/report ID instead of user/report name [$250] Save search - Default name in name field displays user/report ID instead of user/report name Sep 25, 2024
@stitesExpensify stitesExpensify added the Bug Something is broken. Auto assigns a BugZero manager. label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

Copy link

melvin-bot bot commented Sep 25, 2024

Triggered auto assignment to @kadiealexander (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.

@rayane-djouah
Copy link
Contributor

Reviewing 👀

@Nodebrute
Copy link
Contributor

@rayane-djouah I have updated my proposal to add detailed RCA for more clear understanding

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Sep 25, 2024

Offending PR: #49558
(The "name" field population is a new feature that doesn't yet exist in production. This case was missed in the original PR that implemented the feature.)

@rayane-djouah
Copy link
Contributor

@Nodebrute's proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 25, 2024

Current assignee @stitesExpensify is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

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

melvin-bot bot commented Sep 25, 2024

📣 @rayane-djouah 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@Nodebrute
Copy link
Contributor

PR will be ready in 30 minutes

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Sep 25, 2024
@stitesExpensify
Copy link
Contributor

Tested 🟢
2024-09-26_13-44-10

@rayane-djouah
Copy link
Contributor

Note

The production deploy automation failed: This should be on [HOLD for Payment 2024-10-04] according to #49662 production deploy checklist, confirmed in #49757 (comment)

cc @kadiealexander

@luacmartins
Copy link
Contributor

This is no longer a blocker since it was already fixed on the previous checklist

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Sep 30, 2024
@luacmartins luacmartins changed the title [$250] Save search - Default name in name field displays user/report ID instead of user/report name [$250] [Search v2.3] - Default name in name field displays user/report ID instead of user/report name Sep 30, 2024
@luacmartins luacmartins moved this from Polish to Done in [#whatsnext] #expense Sep 30, 2024
@rayane-djouah
Copy link
Contributor

[HOLD for Payment 2024-10-04]

@kadiealexander
Copy link
Contributor

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:

  • [@rayane-djouah] The PR that introduced the bug has been identified. Link to the PR:
  • [@rayane-djouah] 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:
  • [@rayane-djouah] 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:
  • [@rayane-djouah] Determine if we should create a regression test for this bug.
  • [@rayane-djouah] 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.
  • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@kadiealexander
Copy link
Contributor

kadiealexander commented Oct 7, 2024

Payouts due:

Upwork job is here.

@kadiealexander kadiealexander added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 7, 2024
@kadiealexander kadiealexander changed the title [$250] [Search v2.3] - Default name in name field displays user/report ID instead of user/report name [HOLD for Payment 2024-10-04][$250] [Search v2.3] - Default name in name field displays user/report ID instead of user/report name Oct 7, 2024
@rayane-djouah
Copy link
Contributor

BugZero Checklist

Regression Test Proposal

  1. Go to Search
  2. Click Filters
  3. Click To
  4. Select a user and save it
  5. Click Save search
  6. Click 3-dot menu next to the saved search
  7. Click Rename
  8. Verify that the default name in the search name field will display the user name instead of the user ID

Do we agree 👍 or 👎

cc @kadiealexander

@luacmartins
Copy link
Contributor

luacmartins commented Oct 9, 2024

We'll add tests as part of the project wrap up

@rayane-djouah
Copy link
Contributor

@kadiealexander I've accepted the offer

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Oct 13, 2024
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 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
Archived in project
Development

No branches or pull requests

8 participants