Every time my HTC One M8's battery dies, which is roughly once every two weeks, when I charge it and turn it on, a large portion of random settings or configurations are reset to default on the device. This time it happened, it actually erased all of the contacts on my phone, and previously, it's logged me out of all my apps, reset my theme-ing options, and erased all of my music.
Why is that happening? Can I prevent it from happening in the future? Configuring my phone like it's a new device every time the battery dies is quite painful.
The device is on Stock Android 6, latest version available to me (No S-off or Root), and running Sense 7.