fix: show error for tag when create expense#57370
Conversation
|
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Aha, after re-testing this flow, I now understand the first part of your proposal. There is a different character limit when creating a tag name (CATEGORY_NAME_LIMIT: 256) and when creating an expense (API_TRANSACTION_CATEGORY_MAX_LENGTH: 255), and the same is true for tags. This isn't correct, let's indeed fix this. We can remove CATEGORY_NAME_LIMIT and use API_TRANSACTION_CATEGORY_MAX_LENGTH in CategoryForm (and the same for tags)
This, in turn, would mean the QA will not be able to trigger an error when creating an expense, or am I missing something?
|
@eVoloshchak i updated the code change and steps. Please check again |
|
Thanks! |
|
@eVoloshchak I tried with tag length 256, and it is still valid with |
Yes, let's still add it, the same as we do for categories (the logic from the initial version of this PR). If we're setting a limit on the input, I think it's reasonable to check for it on expense creation too for consistency, even if there is no check for it on the backend (we might add it though, I'll raise a discussion in a bit) |
|
@eVoloshchak i updated |
|
@eVoloshchak I think we should not change to function in this case.
|
I don't completely agree with this, many error messages don't (for instance, characterLimit/characterLimitExceedCounter)
That is true. This can be resolved, but is not worth it at all. Proceeding |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-03-13.at.22.18.23.movAndroid: mWeb ChromeScreen.Recording.2025-03-13.at.22.15.27.moviOS: NativeScreen.Recording.2025-03-13.at.22.10.22.moviOS: mWeb SafariScreen.Recording.2025-03-13.at.22.14.06.movMacOS: Chrome / SafariScreen.Recording.2025-03-13.at.22.07.20.movMacOS: DesktopScreen.Recording.2025-03-13.at.22.08.32.mov |
eVoloshchak
left a comment
There was a problem hiding this comment.
@nkdengineer, the code looks good!
There are a couple of things that could be improved in the PR author checklist:
- The test steps only include testing for error handling for categories, but not for tags. Could you please add the steps to test this for tags too?
- The last testing step is "Verify that: with max characters category selected there is no error", but all screenshots in Screenshots/Videos section contain a page with "Tag name exceeds the limit" error
|
thanks @eVoloshchak, i updated the steps and all the screenshots |
eVoloshchak
left a comment
There was a problem hiding this comment.
@nkdengineer, could you resolve the conflicts here please? The code and the checklist are looking good, will do the last sweep of tests tomorrow
|
@eVoloshchak i resolved |
eVoloshchak
left a comment
There was a problem hiding this comment.
There's an inconsistency between creating categories and tags:
- For categories, you cannot enter a name longer than 255
- For tags, you can enter a tag name of any length, but it will show an error (character limit exceeded)
Screen.Recording.2025-03-11.at.12.28.38.mov
Another issue is that you can create a tag with a name length of 256, but when submitting an expense, you get an error saying it should be 255 max
Screen.Recording.2025-03-11.at.12.29.42.mov
@eVoloshchak I fixed |
dangrous
left a comment
There was a problem hiding this comment.
Code looks good, but did we confirm the Spanish translations in #expensify-open-source? Asking because they are different from the message about categories, and I'm guessing they should be essentially the same. If not, could we do that please? Thanks!
|
Good point, asking for confirmation here: https://expensify.slack.com/archives/C01GTK53T8Q/p1741975219191719 |
Co-authored-by: Eugene Voloshchak <copyreading@gmail.com>
|
@eVoloshchak i updated, please check again |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.1.16-0 🚀
|
|
@nkdengineer QA found issue #58816 |
|
Is there another place we needed to update the constant? re: #58816 |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.1.16-4 🚀
|
Explanation of Change
Fixed Issues
$ #56646
PROPOSAL: #56646 (comment)
Tests
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios-mweb.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web-resize.mp4
MacOS: Desktop
desktop.mov