-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Waiting on checklist] [$250] Saved search - Saved search name is blank in the list after clearing name field and saving it #50225
Comments
Triggered auto assignment to @twisterdotcom ( |
We think that this bug might be related to #wave-control |
@twisterdotcom FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
Edited by proposal-police: This proposal was edited at 2024-10-04 11:46:32 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The saved search name appears as blank in the list after the name field is cleared and saved. What is the root cause of that problem?We currently allow saving a search with an empty name. App/src/pages/Search/SavedSearchRenamePage.tsx Lines 35 to 43 in f04c1e9
What changes do you think we should make in order to solve the problem?we have two solutions:
const onSaveSearch = () => {
if (!newName) {
return Navigation.dismissModal();
}
const queryJSON = SearchUtils.buildSearchQueryJSON(q || SearchUtils.buildCannedSearchQuery()) ?? ({} as SearchQueryJSON);
SearchActions.saveSearch({
queryJSON,
newName
});
applyFiltersAndNavigate();
}; POCScreen.Recording.2024-10-04.at.13.32.32.movoptional: Additionally, we can dismiss the modal if the value has not been changed. What alternative solutions did you explore? (Optional)
const onSaveSearch = () => {
if (newName){
const queryJSON = SearchUtils.buildSearchQueryJSON(q || SearchUtils.buildCannedSearchQuery()) ?? ({} as SearchQueryJSON);
SearchActions.saveSearch({
queryJSON,
newName
});
}
applyFiltersAndNavigate();
}; POCScreen.Recording.2024-10-04.at.13.50.09.mov |
Job added to Upwork: https://www.upwork.com/jobs/~021842161451688398163 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Edited by proposal-police: This proposal was edited at 2024-10-07 16:09:55 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Saved search name is blank in the list after clearing name field and saving it What is the root cause of that problem?We currently don't have any implementation in our code to prevent users from saving an empty name. What changes do you think we should make in order to solve the problem?We can return early if App/src/libs/actions/Search.ts Line 54 in b0ef513
What alternative solutions did you explore? (Optional)We can use
And in validate function we can use ValidationUtils.isRequiredFulfilled(savedSearchNewName) . We can do something like this (pseudo-code)
Optional: I have noticed we don't have any charchter limit on this field either we can add another check in
This is the standard character limit that we use in other pages too. We can use the limit of our choice. Alternatively we can also use |
Proposal Updated
|
Edited by proposal-police: This proposal was edited at 2024-10-04 20:29:15 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Saved search name is blank in the list after clearing name field and saving it What is the root cause of that problem?We currently don't have any implementation in our code to prevent users from saving an empty name. What changes do you think we should make in order to solve the problem?Disable the "Save" button when the newName is empty by adding
to the FormProvider POC Screen.Recording.2024-10-04.at.8.35.35.PM.movWhat else we can do?Validate the FormProvider and throw error using Highlight Fields and Inline Errors and Form Alerts |
Proposal updatedAdded what else can we do |
tbiplob Your proposal will be dismissed because you did not follow the proposal template. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The saved search name appears as blank in the list after the name field is cleared and saved. Instead, you wish for the default name for a saved search, i.e. the query, to be stored as new name, rather than the empty string. What is the root cause of that problem?When saving an empty string, the empty string is passed on as is to the SearchActions. What changes do you think we should make in order to solve the problem?It's a very easy fix. |
@abzokhattab @Nodebrute @sher999 I don't think preventing saving the empty string is what we are looking for. |
@mollfpr Thank you for the review. I have updated my alternative solution can you review it again? |
Our API seems already handled with the empty string value for Screen.Recording.2024-10-07.at.23.03.37.mp4The proposal from @AlienistSolution seems to have the correct solution. It implements the same logic as the API response and will handle the offline case on the ND side. 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @chiragsalian, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@mollfpr awesome, happy to help. It's a miniscule change and this is the first time for me doing an Expensify bug. Are you guys gonna fix it yourself since it's so small or am I still supposed to do it? I'm fine either way, but just so I know how we continue from here :) |
Proposal LGTM. Feel free to create a PR @AlienistSolution. Let us know if you have any questions along the way 🙂 |
📣 @AlienistSolution You have been assigned to this job! |
📣 @adeel0202 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.56-9 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 2024-11-11. 🎊 For reference, here are some details about the assignees on this issue:
|
@mollfpr @twisterdotcom 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] |
Payment Summary:
|
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:Test:
Do we agree 👍 or 👎 |
@mollfpr can you fill that checklist out? |
@garrettmknight Yup, sorry I forgot to update the checklist. I'm doing it now! |
@garrettmknight The checklist is filled 🚀 |
$250 approved for @mollfpr |
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.44-7
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The saved search in the list will have the default name instead of blank name after saving empty name.
Actual Result:
The saved search in the list shows empty name.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6624129_1728030229123.20241004_162025.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mollfprThe text was updated successfully, but these errors were encountered: