Monday, February 24, 2025
1 change · saas-18.1
Resolved issues and error corrections
Discuss now plays the new-message sound reliably, including when push notifications are enabled or the user is focused on the app. Users can also turn message sounds off from notification settings, giving them more control over their experience.
Original PR description
Before this commit, when push notifications are enabled, receiving a new message in discuss, was not playing the "new-message" sound effect. This happens because when notifying new message, it plays…
Before this commit, when push notifications are enabled, receiving a new message in discuss, was not playing the "new-message" sound effect. This happens because when notifying new message, it plays the sound at the very end of processing of notify. However, the notify code was early returning in case it detects that there's push notification handled by service worker. This made sense because out-of-focus service has also some code for the showing of push notification, but this is redundant with the service worker behaviour on receiving the push notifcation. However, the sound playing is still desirable, even though the service worker lacks this part of feature. This commit fixes the issue by playing the sound effect of new message early. Also some users really want no sound at all. This commit also adds a new entry "Message sound" in the Notification settings of Discuss to toggle enabling of new message sound (enabled by default). By the way, the playing of new message sound should not be dependent on whether the user has focus or not: other messaging apps play the sound regardless of focus which makes more sense. <img width="653" alt="Screenshot 2025-02-17 at 18 13 26" src="https://github.com/user-attachments/assets/33c40f91-0bb2-42ed-9181-7cbbe0b2e7c6" />