Even worse, if you have an actual night vision potion effect active in a dark cave, and you step in water, everything goes dark for a second while the water-vision system kicks in. Which is super annoying since natural water pockets exist in caves.
I think the solution for at least some of these issues is to implement the following checks before triggering the water-vision rendering:
1. Check for water at player's eye level rather than their position.
2. Check that the player doesn't already have a night vision status effect.
Those are the most important and most easily fixed issues. As for figuring out what the brightest light level should be, that's quite a bit more complicated, but perhaps lighting updates could somehow be calculated in a second pass, ignoring water's attenuation, and those values used for the maximum brightness underwater? I know that sounds like it'd be super inefficient, but it's just an idea off the top of my head.
seems to be fixed in 18w10a.