codemem 0.46.0-beta.2 → 0.46.0-rc.1

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.
package/dist/index.js CHANGED
@@ -7781,19 +7781,22 @@ function createServeCoordinatorMaintenanceDependencies(server) {
7781
7781
  })
7782
7782
  };
7783
7783
  }
7784
+ function coordinatorEnrollmentFailureMessage(result) {
7785
+ const groupLabel = result.failedGroups === 1 ? "group" : "groups";
7786
+ const issueCount = result.issues ?? 0;
7787
+ const issueLabel = issueCount === 1 ? "issue" : "issues";
7788
+ const failures = result.failures ?? [];
7789
+ const failureDetail = failures.length ? ` [${failures.slice(0, 3).map((failure) => `${failure.groupId}:${failure.stage}:${failure.code}`).join(", ")}${failures.length > 3 ? `, +${failures.length - 3} more` : ""}]` : "";
7790
+ const hiddenTimeout = failures.slice(3).some((failure) => failure.code === "request_timeout");
7791
+ return `coordinator enrollment maintenance failed for ${result.failedGroups} ${groupLabel} with ${issueCount} reconciliation ${issueLabel}${failureDetail}${hiddenTimeout ? " (coordinator_timeout)" : ""}`;
7792
+ }
7784
7793
  async function runServeCoordinatorMaintenance(store, dependencies) {
7785
7794
  const projectShares = await dependencies.advancePendingProjectShares(store, { limit: 3 });
7786
7795
  const coordinatorEnrollment = await dependencies.reconcileConfiguredCoordinatorEnrollment(store);
7787
7796
  const enrollmentIssues = coordinatorEnrollment.issues ?? 0;
7788
7797
  const recipientPolicies = await dependencies.reconcileRecipientPolicyProjects(store, { limit: 3 });
7789
7798
  if (projectShares.failed > 0) throw new Error(`share operation maintenance failed for ${projectShares.failed} of ${projectShares.processed} operations`);
7790
- if (coordinatorEnrollment.failedGroups > 0) {
7791
- const groupLabel = coordinatorEnrollment.failedGroups === 1 ? "group" : "groups";
7792
- const issueLabel = enrollmentIssues === 1 ? "issue" : "issues";
7793
- const failures = coordinatorEnrollment.failures ?? [];
7794
- const failureDetail = failures.length ? ` [${failures.slice(0, 3).map((failure) => `${failure.groupId}:${failure.stage}:${failure.code}`).join(", ")}${failures.length > 3 ? `, +${failures.length - 3} more` : ""}]` : "";
7795
- throw new Error(`coordinator enrollment maintenance failed for ${coordinatorEnrollment.failedGroups} ${groupLabel} with ${enrollmentIssues} reconciliation ${issueLabel}${failureDetail}`);
7796
- }
7799
+ if (coordinatorEnrollment.failedGroups > 0) throw new Error(coordinatorEnrollmentFailureMessage(coordinatorEnrollment));
7797
7800
  if (enrollmentIssues > 0) throw new Error(`coordinator enrollment reconciliation found ${enrollmentIssues} ${enrollmentIssues === 1 ? "issue" : "issues"}`);
7798
7801
  if (recipientPolicies.failed > 0) throw new Error(`recipient policy maintenance failed for ${recipientPolicies.failed} of ${recipientPolicies.processed} projects`);
7799
7802
  return {