-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Payment Due June 21] [$250] Can't open tag with tag name with % special characters #42549
Comments
Triggered auto assignment to @Christinadobrzyn ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.app crashes when opening a tag with a name having special characters What is the root cause of that problem?
Line 677 in 788b3f6
What changes do you think we should make in order to solve the problem?there is no need to decode the tagName inside the so we should modify this to: const currentPolicyTag = policyTag.tags[route.params.tagName] ?? Object.values(policyTag.tags ?? {}).find((tag) => tag.previousTagName === route.params.tagName); POCScreen.Recording.2024-05-27.at.10.47.53.AM.mov |
I reported this bug from here, I would love to take over this issue as C+ if this is external |
This comment was marked as outdated.
This comment was marked as outdated.
@DylanDylann do you think this might be related? #41414 |
@Christinadobrzyn The original bug can still be reproduced. Please try again with this name: |
@Christinadobrzyn I can't reproduce your bug here. Could you copy exactly 2 tag names used in your video? |
Ah thanks @DylanDylann - I can reproduce with |
I checked this bug before reporting it. This is a bug from the front end. Let's make it external |
Job added to Upwork: https://www.upwork.com/jobs/~01e766d47beaa045bb |
Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new. |
@Christinadobrzyn This is different from #41414 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Can't open tag name and can't edit tag name with special characters like %. What is the root cause of that problem?Encoding is being done while creating the route: Lines 674 to 681 in 525ad6f
Then, decoding is being done: App/src/libs/Navigation/linkingConfig/config.ts Lines 427 to 438 in 525ad6f
But, in the TagSettingsPage, decoding is being done again which leads to issue of URI malformed exception because the App/src/pages/workspace/tags/TagSettingsPage.tsx Lines 48 to 49 in 525ad6f
Also, the same issue happens when editing a category name to use special characters because optimistic data, success data and failure data use the decode method on already decoded category name. App/src/libs/actions/Policy.ts Line 3351 in 525ad6f
App/src/libs/actions/Policy.ts Line 3370 in 525ad6f
App/src/libs/actions/Policy.ts Line 3389 in 525ad6f
What changes do you think we should make in order to solve the problem?Update to remove
function renamePolicyCategory(policyID: string, policyCategory: {oldName: string; newName: string}) {
const policyCategoryToUpdate = allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`]?.[policyCategory.oldName] ?? {};
const onyxData: OnyxData = {
optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`,
value: {
[policyCategory.oldName]: null,
[policyCategory.newName]: {
...policyCategoryToUpdate,
name: policyCategory.newName,
- unencodedName: decodeURIComponent(policyCategory.newName),
+ unencodedName: policyCategory.newName,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
previousCategoryName: policyCategory.oldName,
},
},
},
],
successData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`,
value: {
[policyCategory.oldName]: null,
[policyCategory.newName]: {
...policyCategoryToUpdate,
name: policyCategory.newName,
- unencodedName: decodeURIComponent(policyCategory.newName),
+ unencodedName: policyCategory.newName,
errors: null,
pendingAction: null,
pendingFields: {
name: null,
},
},
},
},
],
failureData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`,
value: {
[policyCategory.newName]: null,
[policyCategory.oldName]: {
...policyCategoryToUpdate,
name: policyCategory.oldName,
- unencodedName: decodeURIComponent(policyCategory.oldName),
+ unencodedName: policyCategory.oldName,
errors: ErrorUtils.getMicroSecondOnyxError('workspace.categories.updateFailureMessage'),
pendingAction: null,
},
},
},
],
};
const parameters = {
policyID,
categories: JSON.stringify({[policyCategory.oldName]: policyCategory.newName}),
};
API.write(WRITE_COMMANDS.RENAME_WORKSPACE_CATEGORY, parameters, onyxData);
} |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
And remove it in the type object and tests too. This will help save the app's Onyx storage, and help us get rid of unused tech debt. What alternative solutions did you explore? (Optional)NA |
Awesome - we have some proposals to review when you have a moment @DylanDylann! |
Sure, I will review proposals by the end of today or tomorrow |
I updated the proposal a bit to fix a malformed permalink |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@DylanDylann Is it sure that unencodedName needs to be removed? |
@ShridharGoel It's unused in the codebase so there's no reason to keep it. The back-end also doesn't return that field, it just exists in optimistic data. |
Ah okay, let me see if I can get someone else to review the PR. Asking the team - https://expensify.slack.com/archives/C066HJM2CAZ/p1718180871595969 |
Just a heads up - I'm going to be ooo until June 24th so going to assign a teammate to watch this while I'm away @JmillsExpensify you're perfect for this! we're trying to find an engineer to review the PR while @lakchote is ooo. Could you help us find a volunteer? |
Triggered auto assignment to @JmillsExpensify ( |
The PR is merged. Waiting for deploying to production |
@JmillsExpensify The PR is deployed to production 4 days ago. Please update the status of this issue |
Issue not reproducible during KI retests. (First week) |
Looks like the PR was deployed into production on June 14 so the 7 day hold ended on June 21st. This is due for payment. correct? @DylanDylann Payouts due:
Upwork job is here. @DylanDylann do we need a regression test for this? |
@truph01 can you please accept the Upwork offer - #42549 (comment) @DylanDylann do we need a regression test for this? |
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: [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: NA Regression Test Proposal
Do we agree 👍 or 👎 |
Regression test - https://github.com/Expensify/Expensify/issues/408381 Waiting on finalising payment - #42549 (comment) |
This is done other than the payment to @truph01. Moving this to weekly to wait for @truph01 to accept offer - https://www.upwork.com/nx/wm/offer/102802999 |
@Christinadobrzyn Offer accepted, sorry for the delay 🙏 |
Thanks @truph01 - paid out based on this payment summary - #42549 (comment) Closing! |
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: 1.4.75-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
Expensify/Expensify Issue URL:
Issue reported by: @DylanDylann
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1716460972676239
Action Performed:
Expected Result:
The user should access to tag setting page
Actual Result:
App crashes - notice the "uh-oh, something went wrong!" error
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.17.mp4
2024-05-27_16-04-06.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @DylanDylannThe text was updated successfully, but these errors were encountered: