It would be crucial to have that kind of option to cancel upgrade in the game, so you wouldn't waste by accident precious gold coins or materials. Upgrades are way too expensive anyways. I just accidentally clicked upgrade, when I was about to delete building.. Now half the days work is ruined.. I'm not so rich, so I have to really hard to think what to upgrade next.
I already lost materials one other day because of the bug. I accidentally clicked upgrade twice, so game charged me twice. Really makes me feel like I should walk on my toes and tie my hands not to click anywhere by accident..