Close document programmatically and skip "Save your work" prompt


I have the following code in extension:

        documentManager.confirmClosingDocument = false;
        await documentManager.closeAll();

However, JupyterLab still shows an window asking me if I want to save my work. Is it a bug or do I misuse API somehow?

I could, of course, save docs excplicitly

        await app.commands.execute("docmanager:save-all");