Use a counter instead of Math.random for diagnostic filename suffix

This commit is contained in:
Henry Mercer
2026-04-28 12:42:42 +01:00
parent c109008fac
commit 245f6828c4
7 changed files with 22 additions and 12 deletions

View File

@@ -165769,6 +165769,7 @@ function formatDuration(durationMs) {
// src/diagnostics.ts
var unwrittenDiagnostics = [];
var unwrittenDefaultLanguageDiagnostics = [];
var diagnosticCounter = 0;
function makeDiagnostic(id, name, data = void 0) {
return {
...data,
@@ -165811,7 +165812,7 @@ function writeDiagnostic(config, language, diagnostic) {
);
try {
(0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true });
const uniqueSuffix = Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0");
const uniqueSuffix = (diagnosticCounter++).toString();
const sanitizedTimestamp = diagnostic.timestamp.replace(
/[^a-zA-Z0-9.-]/g,
""