App notification sounds fail, but the same ones work in System Settings > Notifications

The Skrooge finance app nightly flatpak build doesn’t make sounds in my upgraded Fedora 43 beta KDE install. So I installed another app with sound notifications KTeaTime, as both an RPM and as a flatpak, and that also doesn’t make any notification sounds. To reproduce launch Skrooge and choose Settings > Configure Notifications… or right-click on KTeaTime in the system tray to bring up its context menu and choose Configure Notifications… Select a notification and press the [:play_button:] play sound button before the semantic name of the notification (e.g. “dialog-error serious”). If I start them from a terminal I see errors

kf.notifyconfig: Failed to play sound with canberra: File or data not found

But… if I go to System Settings > Application Settings > Tea Cooker and click the [:play_button:] play sound button, I do hear something.

I ran strace and I see System Settings > Notifications opens up /home/spage/.cache/event-sound-cache.tdb.<long UUID here>.x86_64-redhat-linux-gnu, and then reads

pread64(27, "ocean\0dialog-error-serious\0en_US"..., 46, 9072) = 46     pread64(27, "\272\206\361h/usr/share/sounds/ocean/ster"..., 60, 9118) = 60

and then opens a few sounds/ locations before opening

openat(AT_FDCWD, "/usr/share/sounds/ocean/stereo/dialog-error-serious.oga", O_RDONLY) = 28

which is the right sound in the theme. But the apps don’t seem to open up any cache, they just try to access dialog-error-serious (with no extension) in various locations without accessing any theme directory, e.g.:

access("/usr/share/sounds/dialog-error-serious", F_OK) = -1 ENOENT (No such file or directory)

It’s as if the apps don’t know about my configured theme, even though System Settings > Notifications does. Ocean is new, replacing Oxygen, and I’ve upgraded KDE several times (without ever messing with sound themes), so maybe I have some leftover config settings causing problems.

I filed bug 510702 . It would be great if someone could try Configure Notifications… in KTeaTime (it’s a tiny app) and click its [:play_button:] play sound button for “Tea is getting lonely” and respond here or in the bug whether it fails or works. Thanks so much!

It looks like the slotPlay() code in knotifyconfig/src/knotifyconfigactionswidget.cpp doesn’t do any sound theme setting or semantic sound naming, unlike the playSound() routines in knotifications/src/notifybyaudio.cpp and plasma-workspace/kcms/notifications/kcm.cpp. They should be sharing one sound-playing function.