I have this problem at home on WiFi, when I am at home I have terrible cell coverage usually bouncing between no coverage and one bar. It seems that when I am bouncing between no cell coverage and one bar my WiFi drops and immediately reconnects.
I had originally thought that my access point was the culprit as I hadn't noticed it happening when I dropped in and out of cell coverage. So I replaced my WiFi system as the one I was on was 8-10 years old. So upgraded to new hardware (WiFi) and tried both 2.4g and 5g and problem persisted.
I have used stock roms, and others, currently on ViperOne 5.8. I have updated to the most current firmware along the way, I even flashed a full RUU and started over last weekend. In addition I have this issue on all three devices in the house (all HTC One M7's).
So today I tried something I should have thought of sooner. I put the phone in airplane mode and then turned on WiFi and noticed that the problem went away, consistent WiFi, no WiFi drop, bounce, etc.
So anyone have an idea as to why this would happen and how I can solve it or is it something that is not solvable except by HTC/Google?