@xdevops/issue-auto-finish 1.0.61 → 1.0.62

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.
@@ -89,4 +89,4 @@ async function startDaemon(configPath) {
89
89
  export {
90
90
  startCommand
91
91
  };
92
- //# sourceMappingURL=chunk-ZBBKZIEX.js.map
92
+ //# sourceMappingURL=chunk-MSZQ3T4G.js.map
@@ -338,7 +338,12 @@ var IssuePoller = class {
338
338
  const isRetry = record.state === "failed" /* Failed */;
339
339
  const result = await this.claimer.tryClaim(issue, notes, { isRetry });
340
340
  if (!result.success) {
341
- logger3.info("Could not claim issue, skipping", { iid });
341
+ if (result.reason === "locked_by_other" || result.reason === "cas_lost") {
342
+ logger3.info("Claim failed (another node owns it), marking as skipped", { iid, reason: result.reason });
343
+ this.tracker.updateState(iid, "skipped" /* Skipped */);
344
+ } else {
345
+ logger3.info("Claim failed with transient error, will retry next cycle", { iid });
346
+ }
342
347
  return;
343
348
  }
344
349
  }
@@ -449,7 +454,7 @@ var IssueClaimer = class {
449
454
  iid,
450
455
  holder: existingLock.payload.nodeId
451
456
  });
452
- return { success: false };
457
+ return { success: false, reason: "locked_by_other" };
453
458
  }
454
459
  const visibleMessage = options?.isRetry ? t("lock.retryMessage") : t("lock.startMessage");
455
460
  const lockBody = buildLockNoteBody(
@@ -484,10 +489,10 @@ var IssueClaimer = class {
484
489
  winnerNode: winner.payload.nodeId
485
490
  });
486
491
  await this.safeDeleteNote(issueId, myNote.id);
487
- return { success: false };
492
+ return { success: false, reason: "cas_lost" };
488
493
  } catch (err) {
489
494
  logger4.error("Claim failed with error", { iid, error: err.message });
490
- return { success: false };
495
+ return { success: false, reason: "error" };
491
496
  }
492
497
  }
493
498
  /**
@@ -8286,4 +8291,4 @@ function migrateKnowledgeDir(srcDir, destDir) {
8286
8291
  export {
8287
8292
  main
8288
8293
  };
8289
- //# sourceMappingURL=chunk-LMTBPYF7.js.map
8294
+ //# sourceMappingURL=chunk-NPCR4ZNN.js.map