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
[Due for payment 2026-03-09] [$250] Notification - Sound still plays when 'Mute all sounds from Expensify' is toggled on #81282
Version Number: v9.3.11-24 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80624 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: iPhone SE 3rd gen, iOS 26.2.1 App Component: Notifications
Action Performed:
Preconditions:
The device has sound enabled and the volume is set high enough.
App notifications enabled.
Open the app.
Tap Account > Preferences.
Toggle on 'Mute all sounds from Expensify'.
Sign in on another device and send a message to the main account.
Expected Result:
When the 'Mute all sounds from Expensify' toggle is on, no sounds should play when receiving a message.
Actual Result:
Even with the 'Mute all sounds from Expensify' toggle on, sounds still play after receiving a message.
Please re-state the problem that we are trying to solve in this issue.
When "Mute all sounds from Expensify" is toggled on in Preferences, iOS push notifications still play a sound when a message is received.
What is the root cause of that problem?
The iOS foreground notification configuration always includes Sound in the presentation options. When the callback checks whether to show a notification, it returns null to use the default options (which include Sound) or [] to hide entirely. It never checks the user's mute preference.
What changes do you think we should make in order to solve the problem?
We should import getIsMuted from BaseSound and modify the callback to return presentation options without Sound when the user has muted sounds. The getIsMuted function already tracks the mute state via an Onyx connection, so we can reuse it here.
import Airship, {iOS} from '@ua/react-native-airship';
import shouldShowPushNotification from '@libs/Notification/PushNotification/shouldShowPushNotification';
+import {getIsMuted} from '@libs/Sound/BaseSound';
import type ForegroundNotificationsModule from './types';
function configureForegroundNotifications() {
Airship.push.iOS.setForegroundPresentationOptions([
iOS.ForegroundPresentationOption.List,
iOS.ForegroundPresentationOption.Banner,
iOS.ForegroundPresentationOption.Sound,
iOS.ForegroundPresentationOption.Badge,
]);
- Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => Promise.resolve(shouldShowPushNotification(pushPayload) ? null : []));+ Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => {+ if (!shouldShowPushNotification(pushPayload)) {+ return Promise.resolve([]);+ }+ if (getIsMuted()) {+ return Promise.resolve([+ iOS.ForegroundPresentationOption.List,+ iOS.ForegroundPresentationOption.Banner,+ iOS.ForegroundPresentationOption.Badge,+ ]);+ }+ return Promise.resolve(null);+ });
}
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
iOS foreground notification sounds play even when the user has enabled “Mute all sounds from Expensify” because the iOS foreground presentation always includes the Sound option and the presentation decision does not check the platform mute NVP.
What is the root cause of that problem?
In this implementation, the earliest incorrect assumption is in src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts, where the default foreground presentation includes iOS.ForegroundPresentationOption.Sound and the setForegroundPresentationOptionsCallback only decides whether to show a notification, not whether sound should be included; this assumption is wrong because it never consults ONYXKEYS.NVP_MUTED_PLATFORMS via getIsMuted(), which directly allows the OS presentation to include Sound even when the platform is muted.
What changes do you think we should make in order to solve the problem?
For iOS foreground notifications, the notification presentation must exclude the Sound option whenever the platform NVP_MUTED_PLATFORMS state indicates the current platform is muted.
Change only the notification presentation layer. Modify configureForegroundNotifications in src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts to synchronously call getIsMuted() and remove Sound from the computed presentation when muted. Notification presentation is the only layer that decides whether the OS emits a sound.
Exact code delta and scope
File(s) changed: src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts
Function / logic modified: configureForegroundNotifications — the Airship.push.iOS.setForegroundPresentationOptionsCallback implementation and import list
// src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.tsimportAirship,{iOS}from'@ua/react-native-airship';importshouldShowPushNotificationfrom'@libs/Notification/PushNotification/shouldShowPushNotification';import{getIsMuted}from'@libs/Sound/BaseSound';importtypeForegroundNotificationsModulefrom'./types';functionconfigureForegroundNotifications(){// Set our default iOS foreground presentation to be loud with a bannerAirship.push.iOS.setForegroundPresentationOptions([iOS.ForegroundPresentationOption.List,iOS.ForegroundPresentationOption.Banner,iOS.ForegroundPresentationOption.Sound,iOS.ForegroundPresentationOption.Badge,]);// Per-notification override: compute presentation synchronously and exclude Sound when platform is muted.// Returning null keeps the default presentation. Returning [] uses no presentation (hides the notification).Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload)=>{if(!shouldShowPushNotification(pushPayload)){returnPromise.resolve([]);}constpresentation=[iOS.ForegroundPresentationOption.List,iOS.ForegroundPresentationOption.Banner,// Only include Sound if the platform is not muted.
...(getIsMuted() ? [] : [iOS.ForegroundPresentationOption.Sound]),iOS.ForegroundPresentationOption.Badge,];returnPromise.resolve(presentation);});}functiondisableForegroundNotifications(){Airship.push.iOS.setForegroundPresentationOptionsCallback(()=>Promise.resolve([]));}constForegroundNotifications: ForegroundNotificationsModule={
configureForegroundNotifications,
disableForegroundNotifications,};exportdefaultForegroundNotifications;
This approach always returns a clear list of notification options. It adds Sound only when the app is not muted and removes it when muted. Because of this, it does not depend on any default settings, and the notification behavior is predictable and fully controlled in one place.
What alternative solutions did you explore? (Optional)
Changing Pusher to Onyx ordering or deferring sound decisions adds cross-layer responsibility and timing complexity.
Adding guards in sound utilities spreads responsibility and increases the chance of missed cases.
The notification-layer change is single-responsibility, synchronous, and minimal.
Please re-state the problem that we are trying to solve in this issue.
When the user enables "Mute all sounds from Expensify" in Preferences, sounds still play when a new message is received (e.g. when someone sends a message from another device). The preference should silence all in-app and notification sounds.
What is the root cause of that problem?
When a message arrives with the app in the foreground, sound can come from two places:
In-app (Pusher) – playSoundForMessageType in User.ts calls playSound(), which already checks getIsMuted() in the Sound layer, so this path respects the preference.
Native push notification – On iOS the default foreground presentation includes Sound. The app decides whether to show the notification via shouldShowPushNotification(), but that function did not consider the "Mute all sounds" preference. So the system could still show the notification and play its sound when the user had muted.
The bug is that foreground push notification handling ignored the mute preference; the in-app sound path already respected it.
What changes do you think we should make in order to solve the problem?
Respect the "Mute all sounds from Expensify" preference in shouldShowPushNotification(). When the user has muted, return false so the foreground notification is not shown (and the system does not play the notification sound). This uses the same mute state as the rest of the app via getIsMuted() from BaseSound.
Change – Respect mute in foreground push notification
importtype{PushPayload}from'@ua/react-native-airship';importLogfrom'@libs/Log';import{getIsMuted}from'@libs/Sound/BaseSound';import*asReportActionUtilsfrom'@libs/ReportActionsUtils';import*asReportfrom'@userActions/Report';importparsePushNotificationPayloadfrom'./parsePushNotificationPayload';/** * Returns whether the given Airship notification should be shown depending on the current state of the app */exportdefaultfunctionshouldShowPushNotification(pushPayload: PushPayload): boolean{Log.info('[PushNotification] push notification received',false,{pushPayload});// When "Mute all sounds from Expensify" is on, don't show foreground notifications so the system won't play notification soundif(getIsMuted()){returnfalse;}constdata=parsePushNotificationPayload(pushPayload.extras.payload);if(!data){returntrue;}// ... rest unchanged}
Summary of change:
Import getIsMuted from @libs/Sound/BaseSound and, at the start of shouldShowPushNotification, return false when getIsMuted() is true. That prevents the system from showing the foreground notification (and playing its sound) when "Mute all sounds from Expensify" is on. Both iOS (foreground presentation callback) and Android (foreground display predicate) use this function, so the fix applies to both platforms.
What alternative solutions did you explore? (Optional)
Only change iOS foreground presentation options (e.g. pass options without Sound when muted)
The Airship iOS API used here returns either null (default, with sound) or [] (no presentation). There is no way in this callback to show the banner without sound. So to avoid sound when muted, we must not show the notification (return false / []). The implemented solution does that.
Play sound only from in-app (Pusher) and disable push sound entirely
That would require broader changes and would affect all users. Respecting the existing mute preference in shouldShowPushNotification is a minimal, consistent fix.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
changed the title [-][Awaiting checklist completion] [Due for payment 2026-03-09] [$250] Notification - Sound still plays when 'Mute all sounds from Expensify' is toggled on[/-][+][Due for payment 2026-03-09] [$250] Notification - Sound still plays when 'Mute all sounds from Expensify' is toggled on[/+]on Mar 11, 2026
TBH I'm not sure I agree with the expected result here. The "mute all sounds" setting only affected in-app sounds so push notifications were not affected. It's been that way for years so I'm not sure why Applause is reporting that as a bug now.
In any case, if we really do want this change, I think we also need to update Android since it has the same problem @Julesssss
Hmm yeah I agree. I didn't think to check the original issue, but original test case correctly pointed this out and the test step was missunderstood.
**Notifications - Receive message backgrounded app**
- Navigate to a conversation that is not the one with the secondary user
- Background the app / Navigate to another tab or minimize the window in web
- Secondary device - Send a message to the user in the main testing device
- Verify the user receives a notification with a sound
This test case doesn't explicitly say whether the received message is a push notification.
@arosiclair so we can update this to specify that notifications sounds is expected when associated with a push notification? I kinda thought we suppressed the notification if user was on that chat. So perhaps we should also add a step to navigate away. Unless that has since changed...
@arosiclair so we can update this to specify that notifications sounds is expected when associated with a push notification? I kinda thought we suppressed the notification if user was on that chat. So perhaps we should also add a step to navigate away. Unless that has since changed...
Yeah the notification should be suppressed for the current chat. They tested in a different chat, so the notification came through and made a sound. I think we should update that test to say the main user should have the chat with the secondary user open. Then there should be no sounds.
Activity
melvin-bot commentedon Feb 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)melvin-bot commentedon Feb 3, 2026
Triggered auto assignment to @twisterdotcom (
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.MobileMage commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When "Mute all sounds from Expensify" is toggled on in Preferences, iOS push notifications still play a sound when a message is received.
What is the root cause of that problem?
The iOS foreground notification configuration always includes Sound in the presentation options. When the callback checks whether to show a notification, it returns
nullto use the default options (which include Sound) or[]to hide entirely. It never checks the user's mute preference.App/src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts
Lines 15 to 17 in bcfa7b4
What changes do you think we should make in order to solve the problem?
We should import
getIsMutedfromBaseSoundand modify the callback to return presentation options without Sound when the user has muted sounds. ThegetIsMutedfunction already tracks the mute state via an Onyx connection, so we can reuse it here.import Airship, {iOS} from '@ua/react-native-airship'; import shouldShowPushNotification from '@libs/Notification/PushNotification/shouldShowPushNotification'; +import {getIsMuted} from '@libs/Sound/BaseSound'; import type ForegroundNotificationsModule from './types'; function configureForegroundNotifications() { Airship.push.iOS.setForegroundPresentationOptions([ iOS.ForegroundPresentationOption.List, iOS.ForegroundPresentationOption.Banner, iOS.ForegroundPresentationOption.Sound, iOS.ForegroundPresentationOption.Badge, ]); - Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => Promise.resolve(shouldShowPushNotification(pushPayload) ? null : [])); + Airship.push.iOS.setForegroundPresentationOptionsCallback((pushPayload) => { + if (!shouldShowPushNotification(pushPayload)) { + return Promise.resolve([]); + } + if (getIsMuted()) { + return Promise.resolve([ + iOS.ForegroundPresentationOption.List, + iOS.ForegroundPresentationOption.Banner, + iOS.ForegroundPresentationOption.Badge, + ]); + } + return Promise.resolve(null); + }); }What alternative solutions did you explore? (Optional)
N/A
twinkle-react commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
iOS foreground notification sounds play even when the user has enabled “Mute all sounds from Expensify” because the iOS foreground presentation always includes the Sound option and the presentation decision does not check the platform mute NVP.
What is the root cause of that problem?
In this implementation, the earliest incorrect assumption is in
src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts, where the default foreground presentation includesiOS.ForegroundPresentationOption.Soundand thesetForegroundPresentationOptionsCallbackonly decides whether to show a notification, not whether sound should be included; this assumption is wrong because it never consultsONYXKEYS.NVP_MUTED_PLATFORMSviagetIsMuted(), which directly allows the OS presentation to include Sound even when the platform is muted.What changes do you think we should make in order to solve the problem?
For iOS foreground notifications, the notification presentation must exclude the Sound option whenever the platform
NVP_MUTED_PLATFORMSstate indicates the current platform is muted.Change only the notification presentation layer. Modify
configureForegroundNotificationsinsrc/libs/Notification/PushNotification/ForegroundNotifications/index.ios.tsto synchronously callgetIsMuted()and remove Sound from the computed presentation when muted. Notification presentation is the only layer that decides whether the OS emits a sound.Exact code delta and scope
File(s) changed:
src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.tsFunction / logic modified:
configureForegroundNotifications— theAirship.push.iOS.setForegroundPresentationOptionsCallbackimplementation and import listThis approach always returns a clear list of notification options. It adds Sound only when the app is not muted and removes it when muted. Because of this, it does not depend on any default settings, and the notification behavior is predictable and fully controlled in one place.
What alternative solutions did you explore? (Optional)
Changing Pusher to Onyx ordering or deferring sound decisions adds cross-layer responsibility and timing complexity.
Adding guards in sound utilities spreads responsibility and increases the chance of missed cases.
The notification-layer change is single-responsibility, synchronous, and minimal.
blazejkustra commentedon Feb 3, 2026
It's a regression from my PR, I'll take care of it.abbasifaizan70 commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When the user enables "Mute all sounds from Expensify" in Preferences, sounds still play when a new message is received (e.g. when someone sends a message from another device). The preference should silence all in-app and notification sounds.
What is the root cause of that problem?
When a message arrives with the app in the foreground, sound can come from two places:
playSoundForMessageTypeinUser.tscallsplaySound(), which already checksgetIsMuted()in the Sound layer, so this path respects the preference.shouldShowPushNotification(), but that function did not consider the "Mute all sounds" preference. So the system could still show the notification and play its sound when the user had muted.The bug is that foreground push notification handling ignored the mute preference; the in-app sound path already respected it.
What changes do you think we should make in order to solve the problem?
Respect the "Mute all sounds from Expensify" preference in
shouldShowPushNotification(). When the user has muted, returnfalseso the foreground notification is not shown (and the system does not play the notification sound). This uses the same mute state as the rest of the app viagetIsMuted()fromBaseSound.Change – Respect mute in foreground push notification
App/src/libs/Notification/PushNotification/shouldShowPushNotification.ts
Lines 1 to 20 in bcfa7b4
After:
Summary of change:
Import
getIsMutedfrom@libs/Sound/BaseSoundand, at the start ofshouldShowPushNotification, returnfalsewhengetIsMuted()istrue. That prevents the system from showing the foreground notification (and playing its sound) when "Mute all sounds from Expensify" is on. Both iOS (foreground presentation callback) and Android (foreground display predicate) use this function, so the fix applies to both platforms.What alternative solutions did you explore? (Optional)
Only change iOS foreground presentation options (e.g. pass options without Sound when muted)
The Airship iOS API used here returns either
null(default, with sound) or[](no presentation). There is no way in this callback to show the banner without sound. So to avoid sound when muted, we must not show the notification (return false/[]). The implemented solution does that.Play sound only from in-app (Pusher) and disable push sound entirely
That would require broader changes and would affect all users. Respecting the existing mute preference in
shouldShowPushNotificationis a minimal, consistent fix.blazejkustra commentedon Feb 3, 2026
@jponikarchuk could you record a video where the app is in the background and you send a message from the second device?
One recording with audio muted in Expensify's settings and one with audio enabled in Expensify's settings 🙏
blazejkustra commentedon Feb 3, 2026
Wait, you can reproduce it in production? @jponikarchuk 🤔
38 remaining items
MobileMage commentedon Mar 9, 2026
Accepted contract @twisterdotcom
eh2077 commentedon Mar 11, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/15858/changes#r2915347383
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/610253
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-b03c-adcb-313c-b2df460fab04eh2077 commentedon Mar 11, 2026
@twisterdotcom checklist done, thanks 🙇
[-][Awaiting checklist completion] [Due for payment 2026-03-09] [$250] Notification - Sound still plays when 'Mute all sounds from Expensify' is toggled on[/-][+][Due for payment 2026-03-09] [$250] Notification - Sound still plays when 'Mute all sounds from Expensify' is toggled on[/+]melvin-bot commentedon Mar 11, 2026
Triggered auto assignment to @johncschuster (
Awaiting Payment)arosiclair commentedon Mar 11, 2026
TBH I'm not sure I agree with the expected result here. The "mute all sounds" setting only affected in-app sounds so push notifications were not affected. It's been that way for years so I'm not sure why Applause is reporting that as a bug now.
In any case, if we really do want this change, I think we also need to update Android since it has the same problem @Julesssss
Julesssss commentedon Mar 11, 2026
Hmm yeah I agree. I didn't think to check the original issue, but original test case correctly pointed this out and the test step was missunderstood.
Julesssss commentedon Mar 11, 2026
This test case doesn't explicitly say whether the received message is a push notification.
@arosiclair so we can update this to specify that notifications sounds is expected when associated with a push notification? I kinda thought we suppressed the notification if user was on that chat. So perhaps we should also add a step to navigate away. Unless that has since changed...
arosiclair commentedon Mar 12, 2026
Yeah the notification should be suppressed for the current chat. They tested in a different chat, so the notification came through and made a sound. I think we should update that test to say the main user should have the chat with the secondary user open. Then there should be no sounds.
Julesssss commentedon Mar 13, 2026
Okay updated. So lets also revert this and go back to our previously expected behaviour.
JmillsExpensify commentedon Mar 24, 2026
$250 approved for @eh2077