Change:
// future. Since we do not restore workspace/folder // windows with backups, this is fine. <del> await this.discardBackupsBeforeShutdown({ except: this.contextService.getWorkbenchState() === WorkbenchState.EMPTY ? [] : Array.from(this.unrestoredBackups) }); </del> <ins> return this.noVeto({ except: this.contextService.getWorkbenchState() === WorkbenchState.EMPTY ? [] : Array.from(this.unrestoredBackups) }); } private noVeto(backupsToDiscard: IWorkingCopyIdentifier[]): Promise<boolean>; private noVeto(backupsToKeep: { except: IWorkingCopyIdentifier[] }): Promise<boolean>; private async noVeto(arg1: IWorkingCopyIdentifier[] | { except: IWorkingCopyIdentifier[] }): Promise<boolean> { // Discard backups from working copies the // user either saved or reverted await this.discardBackupsBeforeShutdown(arg1); </ins> return false; // no veto (no dirty) } private discardBackupsBeforeShutdown(backupsToDiscard: IWorkingCopyIdentifier[]): Promise<void>; private discardBackupsBeforeShutdown(backupsToKeep: { except: IWorkingCopyIdentifier[] }): Promise<void>; <ins> private discardBackupsBeforeShutdown(backupsToDiscardOrKeep: IWorkingCopyIdentifier[] | { except: IWorkingCopyIdentifier[] }): Promise<void>; </ins> private async discardBackupsBeforeShutdown(arg1: IWorkingCopyIdentifier[] | { except: IWorkingCopyIdentifier[] }): Promise<void> { // We never discard any backups before we are ready // and have resolved all backups that exist. This // is important to not loose backups that have not // been handled. if (!this.isReady) { return; }

Discussion:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.73.0-insider OS Version: Windows_NT x64 10.0. Auto Save by onFocusChange does not sync internal cache when direct quitting by 'X' button. Steps to Reproduce: settings: "Files: Auto Save" =onFocusChange a text file and save it somewhere. the file a little more. But this time, do not save or change focus and just press 'X' button directly to quit. the text file again with vscode. to save the file. Now you can see this error message: "Failed to save '...': The content of the file is newer." <img width="341" alt="image" src="https://user-"
That is weird, we trigger auto save on shutdown unless auto save is turned off: Does this still reproduce in all projects?
Oh nice I can reproduce, looks really like a bug.
Great catch!
Thank you for your response and effort on this issue!
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
/verified