You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Notifications - No push notification when admin change expense amount #83533
Version Number: v9.3.26-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:#83171 Email or phone of affected tester (no customers):gocemate+b215490617@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 10/Chrome App Component: Other
Action Performed:
Precondition:
Make sure the browser allows notifications.
Ensure Account A is a workspace member and Account B is a workspace admin.
Steps:
On the web, sign in as Account A and create an expense.
From Account B, update the expense amount
Expected Result:
There should be a push-notification from Account A, verify you receive a notification like: "Account B changed the amount to $X.XX."
Actual Result:
No push notification when admin change expense amount
changed the title [-]Notifications - No push notification when admin change expense amount[/-][+][$250] Notifications - No push notification when admin change expense amount[/+]on Feb 26, 2026
Please re-state the problem that we are trying to solve in this issue.
No push notification when admin changes expense amount.
What is the root cause of that problem?
When an admin (Account B) modifies an expense amount, the backend creates a MODIFIED_EXPENSE report action on the transaction thread report and sends a Pusher update to Account A.
Since the check requires notificationPreference === ALWAYS, the MODIFIED_EXPENSE notification on the transaction thread is always suppressed — the function returns false before reaching the notification display code at showReportActionNotification.
What changes do you think we should make in order to solve the problem?
In shouldShowReportActionNotification, for MODIFIED_EXPENSE actions on transaction threads, we should fall back to the parent report's notification preference instead of using the transaction thread's (which is always HIDDEN).
--- a/src/libs/actions/Report/index.ts+++ b/src/libs/actions/Report/index.ts@@ -3806,7 +3806,13 @@ function shouldShowReportActionNotification(reportID: string, currentUserAccount
}
// We don't want to send a local notification if the user preference is daily, mute or hidden.
- const notificationPreference = getReportNotificationPreference(allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]);+ const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];+ let notificationPreference = getReportNotificationPreference(report);++ if (action?.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE && report?.parentReportID) {+ const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`];+ notificationPreference = getReportNotificationPreference(parentReport);+ }+
if (notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS) {
Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`);
return false;
Note: we can also add the logic to cover other action names
What alternative solutions did you explore? (Optional)
An alternative would be to change the default notificationPreference for transaction threads from HIDDEN to ALWAYS, but that would cause unwanted notifications for every comment on transaction threads, which is not the desired behavior.
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.
Please re-state the problem that we are trying to solve in this issue.
When a workspace admin (Account B) modifies the amount of an expense created by a workspace member (Account A), Account A does not receive any push or browser notification about the change, which prevents the expense creator from being aware that their expense was modified.
What is the root cause of that problem?
Transaction thread reports are created with notificationPreference: HIDDEN by default.
The shouldShowReportActionNotification function checks the notification preference of the report associated with the action. Since the transaction thread has HIDDEN preference, the check at line 3571 fails and the function returns false, blocking the notification entirely.
Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`);
returnfalse;
}
This same function is used by both the local notification path (via triggerNotifications in User.ts) and the push notification path (via shouldShowPushNotification.ts), so no notification is shown on any platform.
What changes do you think we should make in order to solve the problem?
In shouldShowReportActionNotification, when the report is a thread (transaction thread), fall back to checking the parent report's notification preference instead of the thread's own HIDDEN preference. This ensures that if the parent expense report has ALWAYS notification preference, the modified expense notification will be shown.
Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`);
returnfalse;
}
--- a/src/libs/actions/Report/index.ts+++ b/src/libs/actions/Report/index.ts@@ -3567,7 +3567,13 @@ function shouldShowReportActionNotification(reportID: string, currentUserAccount
}
// We don't want to send a local notification if the user preference is daily, mute or hidden.
- const notificationPreference = getReportNotificationPreference(allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]);+ const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];+ let notificationPreference = getReportNotificationPreference(report);++ // Transaction threads have HIDDEN notification preference by default, so check the parent report's preference instead+ if (notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS && isChatThreadReportUtils(report) && report?.parentReportID) {+ notificationPreference = getReportNotificationPreference(allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`]);+ }
if (notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS) {
Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`);
return false;
Summary: No push/browser notification is shown to the expense creator (Account A) when an admin (Account B) changes the expense amount. The client-side App code is fully implemented to handle MODIFIEDEXPENSE notifications — the root cause is almost certainly server-side: the backend is not flagging the Onyx update for notification delivery.
Confidence: High (code evidence is conclusive for the client side; server-side diagnosis is inferred since Web-Expensify is not inspectable here)
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace admin modifies an expense amount created by another user, no push notification (mobile) or browser notification (web) is shown to the expense creator. The expected behavior is a notification like "Account B changed the amount to $X.XX."
functiontriggerNotifications(onyxUpdates,currentUserAccountIDParam){for(constupdateofonyxUpdates){if(!update.shouldNotify&&!update.shouldShowPushNotification){continue;// <-- skips the update entirely if server didn't flag it}// ... triggers showReportActionNotification()}}
When the server sends Onyx updates via Pusher containing a MODIFIEDEXPENSE report action, it must set shouldNotify: true or shouldShowPushNotification: true on the update payload. If neither flag is set, triggerNotifications() skips the update at line 691-692, and no notification is ever shown — on any platform.
The client-side code is fully implemented and correct:
shouldShowReportActionNotification() has no action-type-specific filtering — it applies only generic checks (deleted action, notification preference, same user, currently viewing report, already read, whispers)
The ModifiedExpenseMessage module correctly generates messages like "changed the amount to $18.00 (previously $12.55)"
For mobile specifically: Local notifications are completely no-op on native. Mobile users rely exclusively on server-sent Airship push notifications. If MobilePushNotifications.php in Web-Expensify does not include MODIFIEDEXPENSE in its notifiable action types, mobile users will never see a notification.
This explains the cross-platform nature of the bug (Android App, iOS App, Windows Chrome all affected) — the server is the single point of failure for all platforms.
What changes do you think we should make in order to solve the problem?
The fix needs to happen on the server side (Web-Expensify backend):
For web/browser notifications: Ensure the Onyx update payload containing MODIFIEDEXPENSE report actions (specifically from the UpdateMoneyRequestAmountAndCurrency API command) includes shouldNotify: true when sent to other participants via Pusher.
For mobile push notifications: Ensure MobilePushNotifications.php (or equivalent) sends Airship push notifications for MODIFIEDEXPENSE report actions when an admin modifies another user's expense.
If there is also an App-side concern, the only potential client-side filter that could block the notification is the notification preference check at Report/index.ts:3810 — it requires notificationPreference === ALWAYS. For policy expense chats, the default should be ALWAYS, but this should be verified for the specific expense report type.
What alternative solutions did you explore?
The investigation ruled out several possible client-side causes:
Action-type filtering:shouldShowReportActionNotification() does NOT filter by action type — MODIFIEDEXPENSE is not excluded
isDeletedAction: Does not catch MODIFIEDEXPENSE actions (checked the implementation at ReportActionsUtils.ts:194-222)
Please re-state the problem that we are trying to solve in this issue.
Notification behavior is inconsistent when the admin changes the expense amount:
sometimes no browser push is shown;
sometimes only the notification sound is played, but the chat is not marked unread in LHN.
when multiple unopened notifications arrive, earlier unread notifications can be auto-marked read after a later one arrives.
What is the root cause of that problem?
There are four race-prone points in this flow.
First, push notification filtering resolves the action from payload by taking the latest action from the first reportActions_* Onyx update it finds, instead of selecting the exact action by reportActionID from the push payload.
When multiple report-action updates are present in the same push payload (common for expense edit flows), this can pick an unrelated action. If that unrelated action appears self-authored, notification gating rejects it and no push is shown.
Log.info(`${tag} No notification because comment is from the currently logged in user`);
returnfalse;
}
Second, unread/notification gating treats lastReadTime === action.created as already read. In modified-expense flows, these timestamps can match at millisecond precision, which suppresses unread state even when the action came from another user.
Third, preserving unread by setting lastReadTime to newAction.created - 1ms for each incoming notification can move the unread boundary forward. This can auto-mark older unopened actions as read when a newer action arrives.
Fourth, LHN unread depends on both lastReadTime and lastVisibleActionCreated. Updating only lastReadTime can still leave LHN unread state inconsistent when lastVisibleActionCreated is stale.
What changes do you think we should make in order to solve the problem?
diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts
@@
function getLatestReportActionFromOnyxData<TKey extends OnyxKey>(onyxData: Array<OnyxUpdate<TKey>> | null): NonNullable<OnyxEntry<ReportAction>> | null {
const reportActionUpdate = onyxData?.find((onyxUpdate) => onyxUpdate.key.startsWith(ONYXKEYS.COLLECTION.REPORT_ACTIONS));
@@
const reportActions = Object.values((reportActionUpdate.value as ReportActions) ?? {});
const sortedReportActions = getSortedReportActions(reportActions);
return sortedReportActions.at(-1) ?? null;
}
++/**+ * @returns The exact report action in `onyxData` matching `reportActionID`, or `null` if not found+ */+function getReportActionFromOnyxData<TKey extends OnyxKey>(onyxData: Array<OnyxUpdate<TKey>> | null, reportActionID: string): NonNullable<OnyxEntry<ReportAction>> | null {+ if (!reportActionID) {+ return null;+ }++ const reportActionUpdate = onyxData?.find((onyxUpdate) => {+ if (!onyxUpdate.key.startsWith(ONYXKEYS.COLLECTION.REPORT_ACTIONS)) {+ return false;+ }+ const reportActions = (onyxUpdate.value as ReportActions) ?? {};+ return reportActionID in reportActions;+ });++ if (!reportActionUpdate) {+ return null;+ }++ const reportActions = (reportActionUpdate.value as ReportActions) ?? {};+ return reportActions[reportActionID] ?? null;+}
@@
export {
@@
getLatestReportActionFromOnyxData,
+ getReportActionFromOnyxData,
@@
};
Contributor: @daledah due $125 via NewDot (requested review but tests weren't completed)
Contributor+: @abzokhattab due $125 via NewDot (reviewed proposals, followed PR, no tests.
Activity
melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (
External)melvin-bot commentedon Feb 26, 2026
Triggered auto assignment to @NicMendonca (
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.[-]Notifications - No push notification when admin change expense amount[/-][+][$250] Notifications - No push notification when admin change expense amount[/+]melvin-bot commentedon Feb 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026886058462315518
daledah commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
No push notification when admin changes expense amount.
What is the root cause of that problem?
When an admin (Account B) modifies an expense amount, the backend creates a
MODIFIED_EXPENSEreport action on the transaction thread report and sends a Pusher update to Account A.On the frontend,
triggerNotificationsprocesses the Pusher update and callsshouldShowReportActionNotification, which checks the notification preference of the report:App/src/libs/actions/Report/index.ts
Lines 3808 to 3813 in a152afa
However, transaction thread reports are created with
notificationPreference: HIDDENby default:App/src/libs/ReportUtils.ts
Lines 8634 to 8644 in a152afa
Since the check requires
notificationPreference === ALWAYS, theMODIFIED_EXPENSEnotification on the transaction thread is always suppressed — the function returnsfalsebefore reaching the notification display code atshowReportActionNotification.What changes do you think we should make in order to solve the problem?
In
shouldShowReportActionNotification, forMODIFIED_EXPENSEactions on transaction threads, we should fall back to the parent report's notification preference instead of using the transaction thread's (which is alwaysHIDDEN).Note: we can also add the logic to cover other action names
What alternative solutions did you explore? (Optional)
An alternative would be to change the default
notificationPreferencefor transaction threads fromHIDDENtoALWAYS, but that would cause unwanted notifications for every comment on transaction threads, which is not the desired behavior.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.
mukhrr commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace admin (Account B) modifies the amount of an expense created by a workspace member (Account A), Account A does not receive any push or browser notification about the change, which prevents the expense creator from being aware that their expense was modified.
What is the root cause of that problem?
Transaction thread reports are created with
notificationPreference: HIDDENby default.App/src/libs/ReportUtils.ts
Line 8623 in 641cdeb
When an admin modifies an expense amount, the
MODIFIED_EXPENSEreport action is added to the transaction thread report.App/src/libs/actions/IOU/index.ts
Line 4607 in 641cdeb
The
shouldShowReportActionNotificationfunction checks the notification preference of the report associated with the action. Since the transaction thread hasHIDDENpreference, the check at line 3571 fails and the function returnsfalse, blocking the notification entirely.App/src/libs/actions/Report/index.ts
Lines 3570 to 3574 in 641cdeb
This same function is used by both the local notification path (via
triggerNotificationsinUser.ts) and the push notification path (viashouldShowPushNotification.ts), so no notification is shown on any platform.App/src/libs/Notification/PushNotification/shouldShowPushNotification.ts
Line 35 in 641cdeb
What changes do you think we should make in order to solve the problem?
shouldShowReportActionNotification, when the report is a thread (transaction thread), fall back to checking the parent report's notification preference instead of the thread's ownHIDDENpreference. This ensures that if the parent expense report hasALWAYSnotification preference, the modified expense notification will be shown.App/src/libs/actions/Report/index.ts
Lines 3570 to 3574 in 641cdeb
MelvinBot commentedon Feb 26, 2026
🔍 Issue Analysis
Summary: No push/browser notification is shown to the expense creator (Account A) when an admin (Account B) changes the expense amount. The client-side App code is fully implemented to handle MODIFIEDEXPENSE notifications — the root cause is almost certainly server-side: the backend is not flagging the Onyx update for notification delivery.
Confidence: High (code evidence is conclusive for the client side; server-side diagnosis is inferred since Web-Expensify is not inspectable here)
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace admin modifies an expense amount created by another user, no push notification (mobile) or browser notification (web) is shown to the expense creator. The expected behavior is a notification like "Account B changed the amount to $X.XX."
What is the root cause of that problem?
The App's notification pipeline has a server-controlled gate in
triggerNotifications():When the server sends Onyx updates via Pusher containing a
MODIFIEDEXPENSEreport action, it must setshouldNotify: trueorshouldShowPushNotification: trueon the update payload. If neither flag is set,triggerNotifications()skips the update at line 691-692, and no notification is ever shown — on any platform.The client-side code is fully implemented and correct:
showReportActionNotification()explicitly handlesMODIFIED_EXPENSEaction type with a dedicated code path (line 3873)BrowserNotifications.pushModifiedExpenseNotification()correctly formats the notification body usingModifiedExpenseMessage.getForReportAction()shouldShowReportActionNotification()has no action-type-specific filtering — it applies only generic checks (deleted action, notification preference, same user, currently viewing report, already read, whispers)ModifiedExpenseMessagemodule correctly generates messages like "changed the amount to $18.00 (previously $12.55)"For mobile specifically: Local notifications are completely no-op on native. Mobile users rely exclusively on server-sent Airship push notifications. If
MobilePushNotifications.phpin Web-Expensify does not includeMODIFIEDEXPENSEin its notifiable action types, mobile users will never see a notification.This explains the cross-platform nature of the bug (Android App, iOS App, Windows Chrome all affected) — the server is the single point of failure for all platforms.
What changes do you think we should make in order to solve the problem?
The fix needs to happen on the server side (Web-Expensify backend):
For web/browser notifications: Ensure the Onyx update payload containing
MODIFIEDEXPENSEreport actions (specifically from theUpdateMoneyRequestAmountAndCurrencyAPI command) includesshouldNotify: truewhen sent to other participants via Pusher.For mobile push notifications: Ensure
MobilePushNotifications.php(or equivalent) sends Airship push notifications forMODIFIEDEXPENSEreport actions when an admin modifies another user's expense.If there is also an App-side concern, the only potential client-side filter that could block the notification is the notification preference check at Report/index.ts:3810 — it requires
notificationPreference === ALWAYS. For policy expense chats, the default should beALWAYS, but this should be verified for the specific expense report type.What alternative solutions did you explore?
The investigation ruled out several possible client-side causes:
shouldShowReportActionNotification()does NOT filter by action type — MODIFIEDEXPENSE is not excludedgetForReportActionto be a pure function but did not change notification triggering logicALWAYS, which should pass the preference checkDetailed Investigation
Notification Data Flow
updateMoneyRequestAmountAndCurrency()(IOU/index.ts:8581)MODIFIEDEXPENSEreport action viabuildOptimisticModifiedExpenseReportAction()(ReportUtils.ts:7528)API.write(WRITE_COMMANDS.UPDATE_MONEY_REQUEST_AMOUNT_AND_CURRENCY, ...)sends to servertriggerNotifications()(User.ts:689) checksshouldNotify/shouldShowPushNotificationflags — these are set by the servershouldShowReportActionNotification()(Report/index.ts:3792) checks generic filtersshowReportActionNotification()routes MODIFIED_EXPENSE toLocalNotification.showModifiedExpenseNotification()BrowserNotifications.pushModifiedExpenseNotification()formats and displays the notificationEvidence Chain
triggerNotifications()skips updates without server flagsshouldNotifyshouldShowReportActionNotificationhas NO action-type filteringshowReportActionNotificationshouldNotify/shouldShowPushNotificationare server-setOpen Questions
MobilePushNotifications.phpinclude MODIFIEDEXPENSE in its notifiable action types?shouldNotify: truefor MODIFIEDEXPENSE report actions from admin edits?Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.abbasifaizan70 commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Notification behavior is inconsistent when the admin changes the expense amount:
What is the root cause of that problem?
There are four race-prone points in this flow.
First, push notification filtering resolves the action from payload by taking the latest action from the first
reportActions_*Onyx update it finds, instead of selecting the exact action byreportActionIDfrom the push payload.App/src/libs/Notification/PushNotification/shouldShowPushNotification.ts
Lines 34 to 36 in a152afa
App/src/libs/ReportActionsUtils.ts
Lines 1592 to 1601 in a152afa
When multiple report-action updates are present in the same push payload (common for expense edit flows), this can pick an unrelated action. If that unrelated action appears self-authored, notification gating rejects it and no push is shown.
App/src/libs/actions/Report/index.ts
Lines 3815 to 3819 in a152afa
Second, unread/notification gating treats
lastReadTime === action.createdas already read. In modified-expense flows, these timestamps can match at millisecond precision, which suppresses unread state even when the action came from another user.App/src/libs/actions/Report/index.ts
Lines 3843 to 3844 in a152afa
App/src/libs/ReportUtils.ts
Lines 8902 to 8907 in a152afa
Third, preserving unread by setting
lastReadTimetonewAction.created - 1msfor each incoming notification can move the unread boundary forward. This can auto-mark older unopened actions as read when a newer action arrives.Fourth, LHN unread depends on both
lastReadTimeandlastVisibleActionCreated. Updating onlylastReadTimecan still leave LHN unread state inconsistent whenlastVisibleActionCreatedis stale.What changes do you think we should make in order to solve the problem?
Demo
Screen.Recording.2026-02-26.at.1.30.57.PM.mov
when we already have one existing unread notification
Screen.Recording.2026-02-26.at.1.31.19.PM.mov
48 remaining items
abzokhattab commentedon Jun 7, 2026
cc @mallenexpensify
mallenexpensify commentedon Jun 8, 2026
Payment Summary
Contributor: @daledah due $125 via NewDot (requested review but tests weren't completed)
Contributor+: @abzokhattab due $125 via NewDot (reviewed proposals, followed PR, no tests.
@abzokhattab , @daledah what cha think?
melvin-bot commentedon Jun 8, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)abzokhattab commentedon Jun 8, 2026
looks good to me @mallenexpensify
daledah commentedon Jun 9, 2026
LGTM @mallenexpensify
mallenexpensify commentedon Jun 15, 2026
Thanks @abzokhattab and @daledah , leaving payment summary as-is.
quinthar commentedon Jun 29, 2026
Approved $125 to @abzokhattab
quinthar commentedon Sep 25, 2026
Approved $125 to @daledah