Repository navigation
feat(notifications): ability to customize notification sound, duration, and toggle - #220
Conversation
There was a problem hiding this comment.
Superseded by the review of
e8624854.
This review, of 003907e5
config.config with the defaults. A partial or older config now throws in meeting event handlers or hides notifications without any error. There are also three INFO notes.
Findings: 1 warning · 3 info (4 are inline comments on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
🔧 Fix with your agent
Paste the following into your coding agent to investigate and fix these issues.
Fix the following code review issues found in pull request #220.
Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
## WARNING (1)
### [Code Quality] `notificationConfig` returns `config.config` without merging it with `DEFAULT_NOTIFICATION_CONFIG`. A partial or older `config.config` makes the notification listeners throw a TypeError, or hides every notification key it does not list.
- **File:** packages/core/src/components/rtk-notifications/rtk-notifications.tsx:509
## INFO (3)
### [Code Quality] `createDefaultConfig()` now inherits `participant_joined_sound_notification_limit: 3` instead of 10. This is a behaviour change the description does not mention.
- **File:** packages/core/src/lib/default-ui-config.ts:332
### [Code Quality] The stage-request notification shows an Accept button that calls `stage.grantAccess` without checking `permissions.acceptStageRequests`. The waitlist and new-stage-request notifications do check their permissions.
- **File:** packages/core/src/components/rtk-notifications/rtk-notifications.tsx:399
### [Documentation] The invalid-URL fallback sentence does not hold for `custom`, which has no built-in default sound. The same sentence is in `html-example.md:146` and `react-example.md:145`.
- **File:** packages/core/src/components/rtk-notifications/usage/angular-example.md:154
📋 Code Quality: ⚠️ 1 warning · 2 info
Notification settings are read from config.config without a merge against the defaults. Two smaller points: a changed default sound limit and an Accept button with no permission check.
Recommendation: 📝 Minor Comments
- [WARNING]
notificationConfigreturnsconfig.configwithout merging it withDEFAULT_NOTIFICATION_CONFIG. A partial or olderconfig.configmakes the notification listeners throw a TypeError, or hides every notification key it does not list. (packages/core/src/components/rtk-notifications/rtk-notifications.tsx:509) - [INFO]
createDefaultConfig()now inheritsparticipant_joined_sound_notification_limit: 3instead of 10. This is a behaviour change the description does not mention. (packages/core/src/lib/default-ui-config.ts:332) - [INFO] The stage-request notification shows an Accept button that calls
stage.grantAccesswithout checkingpermissions.acceptStageRequests. The waitlist and new-stage-request notifications do check their permissions. (packages/core/src/components/rtk-notifications/rtk-notifications.tsx:399)
View full review
1. Notification config is no longer merged with the defaults (rtk-notifications.tsx:508-509)
- Before this change,
parseConfigmergednotifications,notification_soundsandnotification_durationfromconfig.configoverDEFAULT_NOTIFICATION_CONFIG. - The new getter falls back to the defaults only when
config.configis missing entirely. - Some configs have a
config.configwithout one of these sub-objects, for example{ videoFit: 'cover' }, or a config built from the old default shape with nonotification_sound_urls. For those configs,isShown,isSoundOn, the duration lookup and the sound URL lookup dereferenceundefinedinside meeting event listeners. The listener throws and no notification appears. - A partial map such as
notifications: { participant_joined: false }now hides every other notification, including ones that default to on. - Fix: merge each map with its defaults in the getter.
2. Default sound limit changed (default-ui-config.ts:332)
createDefaultConfig()now inheritsparticipant_joined_sound_notification_limit: 3(it was 10).- Join, leave and waitlist sounds now stop at much smaller meeting sizes. The description does not mention this.
3. Stage-request Accept button has no permission check (rtk-notifications.tsx:399)
- The newly connected
peerStageStatusListenershows an Accept button that callsstage.grantAccess, but it does not checkpermissions.acceptStageRequests. - The waitlist and
newStageRequestsnotifications both have this check.
📝 Documentation: 💬 1 info
The usage examples describe the invalid-URL fallback inaccurately for custom.
Recommendation: 💬 Optional Nits
- [INFO] The invalid-URL fallback sentence does not hold for
custom, which has no built-in default sound. The same sentence is inhtml-example.md:146andreact-example.md:145. (packages/core/src/components/rtk-notifications/usage/angular-example.md:154)
View full review
All three usage examples say that an invalid URL plays the notification's default sound. custom has no built-in default: playCustomSoundIfEnabled plays the sender's sound if sendNotification() provided one, and otherwise plays nothing. The same sentence appears in html-example.md:146 and react-example.md:145.
✅ All other checks passed
🔒 Security: ✅ LGTM
No security issues found. A custom sound URL is used only when isAudioFileUrl accepts it: an http or https URL whose path ends in an audio extension. The URL is only ever assigned to audio.src. The message rendering path is unchanged.
📖 AGENTS.md: ✅ LGTM
No issues found.
⚡ Performance: ✅ LGTM
No performance issues found.
Reviewed commit: 003907e5
There was a problem hiding this comment.
Superseded by the review of
a63efd97.
This review, of e8624854
💬 Approved with comments — The earlier config-merge problem and the permission gap are fixed. What remains is one WARNING about a stale contributor-doc example and one INFO about the sound URL rules in the usage docs; neither affects production.
Findings: 1 warning · 1 info (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
🔧 Fix with your agent
Paste the following into your coding agent to investigate and fix these issues.
Fix the following code review issues found in pull request #220.
Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
## WARNING (1)
### [AGENTS.md] packages/core/src/utils/AGENTS.md:85-94 still passes `true` as `playSound`; the new signature takes `Sound | string`. Change the example to pass a supported value such as `'message'`. This is contributor documentation and has no effect on production.
## INFO (1)
### [Documentation] The docs say a sound URL must start with http(s), but relative audio paths are also accepted.
- **File:** packages/core/src/components/rtk-notifications/usage/angular-example.md:151
📖 AGENTS.md: ⚠️ 1 warning
The sendNotification example in utils/AGENTS.md is out of date.
Recommendation: 📝 Minor Comments
- [WARNING] packages/core/src/utils/AGENTS.md:85-94 still passes
trueasplaySound; the new signature takesSound | string. Change the example to pass a supported value such as'message'. This is contributor documentation and has no effect on production.
View full review
The example at packages/core/src/utils/AGENTS.md:85-94 still calls sendNotification(..., true). The new signature (packages/core/src/utils/notification.ts:16-19) takes a built-in sound name (joined, left, message) or an audio URL. Change the example to pass, for example, 'message'.
📝 Documentation: 💬 1 info
The documented sound URL rules are narrower than the code.
Recommendation: 💬 Optional Nits
- [INFO] The docs say a sound URL must start with http(s), but relative audio paths are also accepted. (
packages/core/src/components/rtk-notifications/usage/angular-example.md:151)
View full review
The usage docs say a sound URL must start with https: or http:. isAudioFileUrl resolves relative paths against document.baseURI, so a relative path such as /sounds/join.mp3 is also accepted. The same text is in html-example.md and react-example.md.
✅ All other checks passed
🔒 Security: ✅ LGTM
Sound URLs from the config and from events both go through isAudioFileUrl, which accepts only http and https URLs whose path ends in an audio extension. They are only ever assigned to audio.src. The stage-request and waitlist actions are now gated by permission checks.
📋 Code Quality: ✅ LGTM
The notification config is now deep-merged with the defaults (rtk-notifications.tsx:538), and the Accept button on stage requests now checks canAcceptStageRequests(). The new clearTimeout in rtk-notification.tsx stops a notification that replaces another one from closing on the old timer. The meetingId filter on sendNotification events matches the code that consumes it.
⚡ Performance: ✅ LGTM
No performance issues found.
Reviewed commit: e8624854
There was a problem hiding this comment.
✅ Approved — Both earlier findings are fixed: sound URLs must now be absolute, as the docs say, and the AGENTS.md example matches the new signature. No new issues were found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
isAudioFileUrl (lib/notification.ts:28-43) parses the URL without a base, so relative paths are rejected. It accepts only http: and https: URLs whose path ends in an audio extension. The URL is only ever assigned to audio.src. Stage-request and waitlist actions are gated by permission checks.
📖 AGENTS.md: ✅ LGTM
The sendNotification example in packages/core/src/utils/AGENTS.md now passes 'message', which matches the new signature.
📋 Code Quality: ✅ LGTM
The notification config is still deep-merged with the defaults, and the stage-request Accept button checks its permission. In utils/notification.ts, playSound now takes Sound | string, and the event detail type matches. Events carry an optional meetingId, and a listener ignores events whose meetingId belongs to another meeting. Existing callers are unaffected.
⚡ Performance: ✅ LGTM
No performance issues found. Every new listener is removed in clearListeners.
📝 Documentation: ✅ LGTM
The usage docs now say that a relative sound path is rejected, which matches isAudioFileUrl.
Reviewed commit: a63efd97
# [2.2.0-staging.5](https://github.com/cloudflare/realtimekit-ui/compare/@cloudflare/realtimekit-ui-v2.2.0-staging.4...@cloudflare/realtimekit-ui-v2.2.0-staging.5) (2026-11-27) ### Features * **notifications:** ability to customize notification sound, duration, and toggle ([#220](#220)) ([5869c2d](5869c2d)) skip-checks: true
|
🎉 This PR is included in version 2.2.0-staging.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Notifications were never documented. Because of that, there was no standard way to configure them, and customers changed them in ways that we do not officially support. Customers must fix their non official integration code to support this structure.
Only subtractive change is the removal of umbrella notifications keys such as chat, webinar to allow more customization.
What customers can do now
chat_new_message,chat_message_editedandchat_message_deleted. Before, onechatkey covered new messages only, and many notifications had no key at all.notification_sound_urls.sendNotification().0keeps it untilthe user dismisses it.
visible_notifications_limit. The default is 5, as before.Corrected Defaults
New notifications
by default. The code for these existed but was never connected.
Notifications that can now be configured
These were always shown and could not be changed before:
sendNotification()How to configure
There are two official ways to get a UI config. Both return every notification key with
its default value:
createDefaultConfig(), Change the keys in the object. Pass the altered config tortk-ui-providerorrtk-meetingas config.registerAddons()returns. Pass the altered config tortk-ui-providerorrtk-meetingas config.Using createDefaultConfig
Using registerAddons()