Data loss (layout): workspace.json wiped to 0KB when closing Obsidian; all tabs and windows lost

I was never able to reproduce the workspace.json being wiped out. I am able to reproduce the problem of the floating windows being “forgotten”.
It’s possible that Win closes the floating window first, we save the workspace.json without it, and then the app closes. But I have to double check this.

We have exactly the same problem on Mac with the Quit command.

As pjeby said, a workaround is to close the main window first.

For the floating windows being erased continue here.

If you have reproducible steps of workspace.json being wiped out. Please open a new bug report. Thanks!