[$250] Unclear admin system message when update distance rates
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: v9.2.63-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2155/folder/13176744/41237137/1035950355 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Device used: Lenovo 80ES / Windows 10 Pro App Component: Chat Report View
Action Performed:
- Create workspace
- Enable distance rates
- Add new rate
- Disable the new rate
- Go to #admin
- Open the thread
Expected Result:
The last admin system message should clearly indicate the change that happened for the new rate
Actual Result:
generate 2 system messages :
updated the enabled of the Distance rate "New Rate" from "enabled" to "disabled"updated the index of the Distance rate "New Rate" from "" to "1"
The second admin system message is unclear. It reads: "updated the index of the Distance rate "New Rate" from "" to "1" the "1" seems to be a placeholder and doesn't clearly state the change.
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/c45e23dd-fb51-4fc2-a24f-b08f3f52c96a
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021993382977909527240
- Upwork Job ID: 1993382977909527240
- Last Price Increase: 2025-12-23
Triggered auto assignment to @Christinadobrzyn (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.
Unclear admin system message when update distance rates
What is the root cause of that problem?
- The "enabled" and "index" field is not handles here: https://github.com/Expensify/App/blob/dbec56adf78f853d08ba2c88527e5ebb22203044/src/libs/ReportActionsUtils.ts#L2683-L2719
What changes do you think we should make in order to solve the problem?
- We should handle those fields in the function:
if (customUnitRateName && updatedField === 'enabled' && typeof newValue === 'boolean') {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('workspaceActions.updatedCustomUnitRateEnabled', {
customUnitRateName,
newValue,
oldValue: typeof oldValue === 'boolean' ? oldValue : undefined,
});
}
if (customUnitRateName && updatedField === 'index' && typeof newValue === 'number') {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('workspaceActions.updatedCustomUnitRateIndex', {
customUnitRateName,
newValue,
oldValue: typeof oldValue === 'number' ? oldValue : undefined,
});
}
type UpdatedPolicyCustomUnitRateEnabledParams = {customUnitRateName: string; newValue: boolean; oldValue?: boolean};
type UpdatedPolicyCustomUnitRateIndexParams = {customUnitRateName: string; newValue: number; oldValue?: number};
updatedCustomUnitRateEnabled: ({customUnitRateName, newValue, oldValue}: UpdatedPolicyCustomUnitRateEnabledParams) => {
const newValueText = newValue ? 'enabled' : 'disabled';
if (oldValue !== undefined) {
const oldValueText = oldValue ? 'enabled' : 'disabled';
return `changed the distance rate "${customUnitRateName}" to ${newValueText} (previously ${oldValueText})`;
}
return `set the distance rate "${customUnitRateName}" to ${newValueText}`;
},
updatedCustomUnitRateIndex: ({customUnitRateName, newValue, oldValue}: UpdatedPolicyCustomUnitRateIndexParams) => {
if (oldValue !== undefined) {
return `changed the index of the distance rate "${customUnitRateName}" to ${newValue} (previously ${oldValue})`;
}
return `set the index of the distance rate "${customUnitRateName}" to ${newValue}`;
},
- Also handle other field if missing.
- Translations can be updated and changed during the PR work.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
I have updated my proposal. I hope that's not an issue.
Thanks for the proposal @Rkdev09! Adding a C+ to review. I can reproduce with the steps in the OP.
Job added to Upwork: https://www.upwork.com/jobs/~021993382977909527240
Triggered auto assignment to @dannymcclain (Design), see these Stack Overflow questions for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (External)
Also adding design as I think we need to determine what wording we want to use instead of "1" for the rate change.
Maybe we just remove this link all together? updated the index of the Distance rate "New Rate" from "" to "1" and only use updated the enabled of the Distance rate "New Rate" from "enabled" to "disabled"
updated the index of the Distance rate "New Rate" from "" to "1"
Where is this message coming from? It makes no sense to me and I don't know why we'd surface this to users haha. I think we need to either remove it, or figure out what it's trying to communicate and rewrite it to make sense.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The system message shown to admins when updating Distance rates is unclear or unnecessary.
What is the root cause of that problem?
-
For the message: "updated the enabled of the Distance rate 'New Rate' from 'enabled' to 'disabled'"
- There is currently no logic to handle this message type in https://github.com/Expensify/App/blob/29e1abf9b6c6bb3b0465f09a6d7e3234d44b421f/src/libs/ReportActionsUtils.ts#L2683, so it falls back to a generic handler at https://github.com/Expensify/App/blob/29e1abf9b6c6bb3b0465f09a6d7e3234d44b421f/src/libs/ReportActionsUtils.ts#L2718, resulting in an unclear message.
-
For the message: "updated the index of the Distance rate 'New Rate' from '' to '1'"
- As per this comment, this message is not useful for users and should not be shown. However, there's currently no logic on the frontend to suppress it.
What changes do you think we should make in order to solve the problem?
- For the message: "updated the enabled of the Distance rate 'New Rate' from 'enabled' to 'disabled'"
- Add a condition at https://github.com/Expensify/App/blob/29e1abf9b6c6bb3b0465f09a6d7e3234d44b421f/src/libs/ReportActionsUtils.ts#L2697 to handle updates to the
enabledfield of a custom unit rate:
- Add a condition at https://github.com/Expensify/App/blob/29e1abf9b6c6bb3b0465f09a6d7e3234d44b421f/src/libs/ReportActionsUtils.ts#L2697 to handle updates to the
if (customUnitName && customUnitRateName && updatedField === 'enabled') {
return translateLocal('workspaceActions.updateCustomUnitEnabled', {
customUnitName,
customUnitRateName,
newValue,
});
}
- Add the following translation string:
updateCustomUnitEnabled: ({customUnitName, customUnitRateName, newValue}) => `${newValue ? 'enabled' : 'disabled'} the ${customUnitName} rate "${customUnitRateName}"`,
-
For the message: "updated the index of the Distance rate 'New Rate' from '' to '1'"
- Create a helper function to detect and filter out this specific message type:
function isEnableCustomUnitRateIndexMessage(action: ReportAction) {
return (
action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT_RATE &&
getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT_RATE>)?.updatedField === 'index'
);
}
- Use this helper in https://github.com/Expensify/App/blob/29e1abf9b6c6bb3b0465f09a6d7e3234d44b421f/src/libs/ReportActionsUtils.ts#L912 to suppress rendering:
if (isEnableCustomUnitRateIndexMessage(reportAction)) {
return false;
}
What alternative solutions did you explore? (Optional)
Gonna tag @Expensify/product-pr here in case any of them have any more context on where this weird system message is coming from/why.
@Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!
@Krishna2323 Huh... This is 4 days overdue. Who can take care of this?
Waiting for @Expensify/product-pr team response on this.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Still waiting for @Expensify/product-pr team response on https://github.com/Expensify/App/issues/75997#issuecomment-3581509153.
@dannymcclain can you confirm who is on the @Expensify/product-pr team? There doesn't seem to be anyone linked to that group in GH so just trying to figure out if I should reach out to someone in Slack?
Oh what the heck? Did something change with that handle recently? I know @JmillsExpensify and @trjExpensify should be in that group at the very least.
yeah, we're working on the notification issues. @neil-marcellini might actually be best to answer this question. FWIW though, I don't think this system message should exist at all.
Oh what the heck? Did something change with that handle recently?
Fixed now!
Edit: This is not fixed, it caused us to be notified again for every PR created so I had to remove us again. If you need us, feel free to tag Jason, me, Joe and Jenny for now.
@trjExpensify is the fix deployed to staging? I can still reproduce the issue.
Sorry, I was addressing @dannymcclain's question on the GH handle. Not commenting on the bug.
@trjExpensify @JmillsExpensify ahh, sorry — is there any chance you know about this system message? These seem to be new messages sent from the BE; I haven’t seen them before. The index message doesn't seem very helpful to me, and the BE shouldn’t send it if we don’t want to show it.
Should I trigger an assignment to CME to discuss this further?
Yeah, I don't have any recollection of where that came from... sorry! I think @rayane-d and @jamesdeanexpensify have been doing some work on policy audit logs recently, @sakluger originally.
Ah, yeah, I brought this up here just because I happened to be skimming the channel. Shall we come to a conclusion there?
Agree that system messages shouldn't make any reference to a BE index.
Yeah, I don't have any recollection of where that came from... sorry! I think @rayane-d and @jamesdeanexpensify have been doing some work on policy audit logs recently, @sakluger originally.
I've been working on implementing the missing policy change logs, but I haven't touched anything related to the distance rates system messages, so I don't believe this is coming from my changes. I can take a look when I get a chance, though. In the meantime, let's apply the hot-pick label.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Oh yeah, looks like I either forgot to test distance rates, or forgot to document my findings when I tested audit logs recently.
We're discussing the correct language to use here: https://expensify.slack.com/archives/C01GTK53T8Q/p1765036730028859
@dannymcclain @Christinadobrzyn @Krishna2323 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!