Writing to .obsidian/app.json during Plugin.onLoad does nothing

I have a settings manager plugin so I can implement a settings system similar to vscode (separate user & workspace settings, that are merged).

It writes to .obsidian/app.json during Plugin.onLoad in order to make sure the settings are up-to-date, but the changes aren’t displayed.

The following workaround does work, but obviously “wait 500ms that should be ok” isn’t a great strategy

        // for some reason if we don't wait a bit, the file
        // isn't actually written
            async () => await this.mergeSettings(),
            500 /*ms*/,