Howdy new here but i had to register to get in on this thread and hopefully provide a fix.
Im not entirely sure if i have the exact same problem but i have bin spending 3 months researching and testing myself and found something that seems to work so far in my situation including after reboots.
So from the start...
After updating my redmi note 5 to android oreo 8.1 i stopped getting whatsapp notification sounds. as im a light user i didnt fully realize this intill a while later and people told me in not responded.
So i went ewn took a closer look and indeed no notification sounds.
However this is were our situations MIGHT differ. at first i thought i got no notifications at all but shortly after i figured out i needed to give apps permission to post icons in the top bar or apear on the lockscreen.
To give permissions for my phone its to show notifications on lockscreen : settings > Notifications and Statusbar >enable show on lockscreen.
To give permisssions to show notifications on status bar : settings > Notifications and Statusbar > App-notifications > select the app you have issue with and tick the show notifications box.
(names might differ seeing my phone is not in english and this is freely translated by me to what should be the right setting name)
After doing this i realized that the messages did come in but it simply refused to play any sounds to notify me that i had a message. As when i turned on my screen i saw the whatsapp icon on top telling me there was anitification.
so after then there was a 2 months long search testing and testing setting after setting resetting the phone testing some more untill i found 1 small guide by someone that actualy helped me realize what the problem was for me and hopefully for you lot aswell or atleast someone else who comes to this topic with the same annoying problem.
The reason there were no sounds was because for some unknown reason whatsapp in my case despite having high priority messages enabled in settings did not deliver notifications with high priority but with medium priority.
Short background on low medium and high priority.
Low : no sound no delivery message will be collected when you turn on the screen.
Medium : message will be delivered but no sound will be played.
High : message will be delivered and sound will be played
there are more settings for for example turning on the screen or showing a popup screen but lets keep it simple.
So after reading that basics on how doze handled those message priorities a lightstarted to blink and i started looking at more specific solutions and found that others already had these kind of iddies and made a tasker addon for it that can also be used on stand alone.
so the fix :
Go to the play store and download the app AutoNotification made by joaomgcd.
start the app and click on Use for free (adds to unlock the functionality you only have to do this once)
then scroll down and click on notification interception > check intercept all if not checked > on top click on enable notification intercept > enable autonotification permission.
Go back to the start screen of the app and click on notification categories.
From there select the apps you have issues with and set priority to High for the right notification channels (i just did all for whatsapp).
After this drag the app to a flder with apps you never use and leave it there. Uninstalling undo's this sound fix (tested that).
This app had zero idle drain if left inactive after 2 weeks of testing so it only costs a few mb of storage so its completely harmless to leave idle there.
I hope this helps people and is as complete as it should be as my trail of this app ended and can no longer verify the last step.
Added bonus with this app you can also disable annoying notifications or disable the sound for it if you feel like it.
The crazy **** we have to do with mobiles in 2019...and we thought rooting to delete bloatware was bad...
Im not one to stick arround on forums but ill try to open the forum once or twice more to see if there are any questions
Again hope this helps people as these issues certainly cost me 2 years of my life and gave me half my grey hairs...