chore: harden trace file regex (#34563)

This commit is contained in:
Yury Semikhatsky 2025-01-31 15:34:53 -08:00 committed by GitHub
parent 399ba91150
commit da12af24c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -335,7 +335,7 @@ async function mergeTraceFiles(fileName: string, temporaryTraceFiles: string[])
// Keep the name for test traces so that the last test trace
// that contains most of the information is kept in the trace.
// Note the reverse order of the iteration (from new traces to old).
} else if (entry.fileName.match(/[\d-]*trace\./)) {
} else if (entry.fileName.match(/trace\.[a-z]*$/)) {
entryName = i + '-' + entry.fileName;
}
if (entryNames.has(entryName)) {

View File

@ -43,7 +43,7 @@ export class TraceModel {
const ordinals: string[] = [];
let hasSource = false;
for (const entryName of await this._backend.entryNames()) {
const match = entryName.match(/(.+)\.trace/);
const match = entryName.match(/(.+)\.trace$/);
if (match)
ordinals.push(match[1] || '');
if (entryName.includes('src@'))