RocketChat / RocketChat/Rocket.Chat
Audio preview in preferences page not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
The audio preview is not playing properly when changing the notification sound. Previously, when changing the notification sound for either new room or new message a preview sound was played. Now, nothing plays and a javascript error is thrown in the chrome console: n.play is not a function.
It looks like the issue is in packages/rocketchat-ui-account/client/accountPreferences.js on line 220. The current code attempts to call .play() on a jquery object, where it should be calling it on the first element of the object ($audio[0].play, rather than $audio.play()).
I can confirm that the notification sounds themselves still work when triggered by the appropriate event (e.g. receiving a new message), so this is a minor issue that seems to only affect the preferences screen.
Steps to Reproduce:
1.Go to My Account -> Preferences
2.Change either the "New Room Notification" or "New Message Notification" sounds
Expected behavior:
You should hear the preview of the notification sound being played.
Actual behavior:
Nothing is played and a JS error occurs in the developer console.
Relevant logs:
47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:239
Uncaught TypeError: n.play is not a function
at Object.change .audio (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:239)
at 47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79
at Function.e._withTemplateInstanceFunc (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79)
at f.View.<anonymous> (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79)
at 47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79
at Object.f._withCurrentView (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79)
at f._DOMRange.<anonymous> (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79)
at HTMLSelectElement.<anonymous> (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:79)
at HTMLDivElement.dispatch (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:11)
at HTMLDivElement.h.handle (47ef86419001bddc0597ab8520010ea813a957bf.js?meteor_js_resource=true:11)```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open packages/rocketchat-ui-account/client/accountPreferences.js around line 220 and reproduce the issue from My Account → Preferences by changing either notification sound. Verify that the selected preview plays and the n.play is not a function error no longer appears in the Chrome console.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100