deflake 1.2.47 → 1.2.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +10 -0
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -375,6 +375,7 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '', backu
375
375
 
376
376
  console.log(`${C.BRIGHT}🔍 Analyzing ${artifacts.length} failure(s)...${C.RESET}\n`);
377
377
  let count = 0;
378
+ const fixedFiles = new Set(); // Dedup: track files already fixed to avoid cascading mutations
378
379
  for (let i = 0; i < artifacts.length; i++) {
379
380
  const art = artifacts[i];
380
381
  console.log(`${C.CYAN}━━━ [${i+1}/${artifacts.length}] ${art.name} ━━━${C.RESET}`);
@@ -404,6 +405,14 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '', backu
404
405
  // Step 1: Location extraction
405
406
  if (loc) {
406
407
  console.log(` ${C.GRAY}📍 Location:${C.RESET} ${path.basename(loc.path)}:${loc.line} ${C.GRAY}(from ${locSource})${C.RESET}`);
408
+
409
+ // Dedup: skip if this source file was already fixed by a previous artifact
410
+ const fileKey = loc.path;
411
+ if (fixedFiles.has(fileKey)) {
412
+ console.log(` ${C.GREEN}⏭️ Already fixed by a previous artifact — skipping duplicate${C.RESET}`);
413
+ console.log('');
414
+ continue;
415
+ }
407
416
  } else {
408
417
  console.log(` ${C.YELLOW}📍 Location: Could not extract from any source${C.RESET}`);
409
418
  }
@@ -520,6 +529,7 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '', backu
520
529
  console.log(` ${C.BRIGHT}💉 Applying patches...${C.RESET}`);
521
530
  if (await applyFix(res, fixLoc, backups)) {
522
531
  count++;
532
+ fixedFiles.add(fixLoc.path); // Track: don't fix this file again
523
533
  console.log(` ${C.GREEN}${C.BRIGHT}✅ Fix applied to ${path.basename(fixLoc.path)}:${fixLoc.line}${C.RESET}`);
524
534
  } else {
525
535
  console.log(` ${C.YELLOW}⚠️ Patches could not be applied (see details above)${C.RESET}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {