This thread is quite the same thing that happened to me: Raspberry pi 3 Wifi issues on poor signal
See post #17 someone came up with a good way to test it.
So far I’ve been checking internet connection inside my app and restarting the raspberry’s wifi interface after a few minutes.