Skip to content

Commit 45c6119

Browse files
committed
reverify token after parsing compiler log output.
1 parent 295b494 commit 45c6119

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

server/src/incrementalCompilation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,14 @@ async function compileContents(
556556
`${stderr}\n#Done()`,
557557
);
558558

559+
// reverify: Token may have changed during the await above
560+
if (!verifyTriggerToken(entry.file.sourceFilePath, triggerToken)) {
561+
getLogger().log(
562+
`Discarding stale compilation results for ${entry.file.sourceFileName} (token mismatch after parsing)`,
563+
);
564+
return;
565+
}
566+
559567
const actions = Object.values(codeActions)[0] ?? [];
560568

561569
// Code actions will point to the locally saved incremental file, so we must remap

0 commit comments

Comments
 (0)