Quit tasks cause `Reload app without saving` command to terminate application

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

1 Like

Yeah this might be a bug. Obsidian doesn’t relaunch if you call .add() or .addPromise() inside the quit function, and I think that’s how you’re supposed to use it?