The code in createObjectStores are all synchronization function calls. We dispatches `upgradestart` just few lines before, call createObjectStores here, and dispatch `upgradeend` right after it. The UI thread may not have any opportunity to update the GUI. That's what I want to say... That also means the event dispatching may be useless, but can help client app to know the state, in this case.