When adding quit tasks inside a quit event callback, no matter what the task, it will cause obsidian to call window.close()
when using the command Reload app without saving
.
MRE
import {Plugin, Tasks} from 'obsidian';
export default class TestCrashPlugin extends Plugin {
async onload() {
this.registerEvent(
this.app.workspace.on("quit", async (tasks: Tasks) => {
tasks.addPromise(Promise.resolve());
})
);
}
}
Then use the command Reload app without saving
Expected result: The app reloads normally
Actual result: The app terminates