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

[$250] [Search v2.3] - Default name in name field displays user/report ID instead of user/report name #49739

Open
6 tasks done
lanitochka17 opened this issue Sep 25, 2024 · 21 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 25, 2024

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: 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): applausetester+kh230901@applause.expensifail.com
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

Copy link

melvin-bot bot commented Sep 25, 2024

📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

8 participants