[$250] Workspace - System message changes in the #admins room after changing WS description
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.71-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5296387&group_by=cases:section_id&group_id=229065&group_order=asc Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team
Action Performed:
- Navigate to https://staging.new.expensify.com/
- Log in with a Gmail account
- Create a new workspace
- Navigate to Workspace settings - Description
- Replace the default description with a few letters
- Navigate to the #admins room of the workspace
Expected Result:
System message should be "updated the description of this workspace to".
Actual Result:
System message changes in the #admins room after changing WS description. "updated the description of this workspace from "" to" message is briefly visible before it changes to "updated the description of this workspace to".
Workaround:
Unknown
Platforms:
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [x] Android: mWeb Chrome
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/0debf403-1158-4e0e-89f9-aeb2de515a30
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021864276008252275164
- Upwork Job ID: 1864276008252275164
- Last Price Increase: 2024-12-04
Issue Owner
Current Issue Owner: @mountiny
Triggered auto assignment to @trjExpensify (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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
System message changes in the #admins room after changing WS description. "updated the description of this workspace from "" to" message is briefly visible before it changes to "updated the description of this workspace to".
What is the root cause of that problem?
We don't have a translation for POLICYCHANGELOG_UPDATE_DESCRIPTION action and it displays the message[0]?.html by default. After we change the workspace's description, the backend returns the message updated the description of this workspace from "" to. But it's changed to updated the description of this workspace to ... after OpenReport API is called
What changes do you think we should make in order to solve the problem?
- We need to define a new translation for
POLICYCHANGELOG_UPDATE_DESCRIPTIONaction. It isupdated the description of this workspace from "${oldDescription}" to "${newDescription}"ifoldDescriptionis not empty. If not, it isupdated the description of this workspace to "${newDescription}"ifoldDescriptionis empty
updateDescription: ({oldDescription, newDescription}: {oldDescription: string; newDescription: string}) =>
`updated the description of this workspace ${oldDescription ? `"from ${oldDescription} "` : ''}to "${newDescription}"`,
- Add
CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTIONas an old dot action
https://github.com/Expensify/App/blob/00f0deef12e963295eacede1ba905254e310cf1e/src/libs/ReportActionsUtils.ts#L1245
- Add a case for this action in
getMessageOfOldDotReportActionfunction so it can work in all places like LHN,ReportActionItem, thread name header, copy to clipboard
case CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTION: {
const {oldDescription, newDescription}
return Localize.translateLocal('workspace.common.updateDescription', {oldDescription, newDescription})
}
https://github.com/Expensify/App/blob/00f0deef12e963295eacede1ba905254e310cf1e/src/libs/ReportActionsUtils.ts#L1289
OPTIONAL: When we update workspace description we can generate this action in optimistic data and send the reportActionID to backend to generate this action
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Job added to Upwork: https://www.upwork.com/jobs/~021864276008252275164
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)
@nkdengineer's proposal LGTM. I think a unit test might be appropriate here though?
:ribbon::eyes::ribbon: C+ reviewed
Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
I think a unit test might be appropriate here though?
If we want I think we can add a unit test for getMessageOfOldDotReportAction with CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTION and verify that the translation is returned correctly for each case of oldDescription and newDescription.
this needs to be fixed on the BE i guess, if the admin/owner is editing description for the first time, this bug occurs because BE doesn't check if we are editing for the first time. The OpenReport call sends the correct data which means we only need to fix the changelog when the user updates the description, what do you think @jjcoffee ?
This is a BE bug
Ah my bad I thought it was being set optimistically! @mountiny I guess it doesn't make sense to add a new translation for POLICYCHANGELOG_UPDATE_DESCRIPTION? If that's the case this can be internal.
I guess it doesn't make sense to add a new translation for POLICYCHANGELOG_UPDATE_DESCRIPTION
We already do this for update room description so I think we can do the same for update policy description.
https://github.com/Expensify/App/blob/ccc5efdbccbc2b19f22431ab98df16f01b7d744e/src/languages/en.ts#L5302
cc @trjExpensify What do you think?
Still need to make this change in the be
Gotcha, okay.
Started a draft
@trjExpensify, @jjcoffee, @mountiny Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
How's the draft going?
Was focusing on the fireroom, took it out of draft
@trjExpensify, @jjcoffee, @mountiny Whoops! This issue is 2 days overdue. Let's get this updated quick!
Alrighty, that Auth PR has been deployed. Are we good here?
@trjExpensify What do you think about my comment here https://github.com/Expensify/App/issues/53534#issuecomment-2517975987?
Do other actualy workspace change logs to settings on the workspace get translated now, or only this room description example?
Do other actualy workspace change logs to settings on the workspace get translated now,
@trjExpensify Yes some other change logs like remove/invite member, update workspace name,... have already translated.
"some other" ... but not all workspace change logs? 🤔
Yes, not all workspace change logs.
That's a sorta' weird inconsistency. Any idea why, @JmillsExpensify?
@trjExpensify I think this because we have many workspace change logs action, we're only focusing on the translation for the popular system logs mentioned above.
Hm, I don't think "workspace description" is that popular. But equally, whatever they change it to will be in the language they write. So I think it's probably fine.
I do think we should consider being consistent with translating workspace change logs and not partial ones though at some point.
@trjExpensify, @jjcoffee, @mountiny 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@trjExpensify, @jjcoffee, @mountiny Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!