@henrikra The mirror application itself doesn’t connect to the internet. It uses your existing network connections as configured in the Raspbian operating system. The Raspbian installation already contains auto-reconnect out of the box. (this arrangement means that you can use a wireless connection, an ethernet connection or a bluetooth connection and the mirror will grab whatever is at hand).
The failure to connect to GitHub is most likely the Update module checking to see if the Magic Mirror application has been updated. It’s what pops up the “An update to XXX is available!” notification.
I don’t know how flaky your internet connection is, but it definitely seems like something you will have to account for in your coding. The update module seems to gracefully handle it and try again when the connection has been restored. Perhaps you can look to it for ideas.
In the meantime, I would suggest an sudo apt-get update & sudo apt-get upgrade to make sure that you have any improvements to the networking of your Raspbian installation.