Mine hasn't encounter that yet. Lets narrow it down. It can be the actual WiFi connection you are connected. Wireless internet can be intermittent also causing devices to lose signal. Wi-Fi router can be interrupted with so many factors too. Have u tested other phones to connect with the same WiFi? Please check too if it's happening. If yes then it's the WiFi network problem. Have the router be rebooted and if still the same, call your dsl provider.

If it's only happening with your MiA1, did it happen after the oreo update or if you can remember what was the changed in your phone that may affect. If none, RESET the network settings. This will remove all the saved settings in your phone about network along with Wi-Fi you were connected before. After the network reset, turn off the phone and wait a bit. So the WiFi hardware chip will refresh itself. Turn it on and reconnect to your WiFi. (Please be sure u know the WiFi password before doing this. Also your mobile network settings will be reset to default too so be mindful of this)

If all else fail, #StopGivingUp. We involve Mi dev team by sending a feedback.