If the resources you have collected disappeared or if your upgrade hasn’t gone through, then it might be that you have experienced a small rollback.

This kind of rollback happens when your connection drops for some seconds and the game hasn’t yet saved your last actions. So when you get back into the game, you start from the state before your last actions were done.

Note: Sometimes, you can experience a rollback if you open the game after it was minimized for a long time.