paperclip-github-plugin 0.9.4 → 0.9.6
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/manifest.js +1 -1
- package/dist/ui/index.js +35 -4
- package/dist/ui/index.js.map +2 -2
- package/dist/worker.js +28 -1
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -5669,7 +5669,16 @@ function resolveSyncTransitionAssignee(params) {
|
|
|
5669
5669
|
}
|
|
5670
5670
|
function isHealthyMaintainerWaitTransition(params) {
|
|
5671
5671
|
const { currentStatus, nextStatus, syncContext } = params;
|
|
5672
|
-
return nextStatus === "in_review" && (currentStatus === "done" || currentStatus === "in_review") && syncContext.executionState
|
|
5672
|
+
return nextStatus === "in_review" && (currentStatus === "done" || currentStatus === "in_review") && isClearableMaintainerWaitExecutionState(syncContext.executionState);
|
|
5673
|
+
}
|
|
5674
|
+
function isClearableMaintainerWaitExecutionState(executionState) {
|
|
5675
|
+
if (executionState === null) {
|
|
5676
|
+
return true;
|
|
5677
|
+
}
|
|
5678
|
+
if (executionState.currentParticipant !== null || executionState.returnAssignee !== null || executionState.currentStageId !== null || executionState.currentStageIndex !== null || executionState.currentStageType !== null || executionState.completedStageIds.length > 0 || executionState.lastDecisionId || executionState.lastDecisionOutcome) {
|
|
5679
|
+
return false;
|
|
5680
|
+
}
|
|
5681
|
+
return !executionState.status || executionState.status === "idle" || executionState.status === "completed";
|
|
5673
5682
|
}
|
|
5674
5683
|
function shouldClearCompletedSyncExecutionPolicy(params) {
|
|
5675
5684
|
return (params.nextStatus === "done" || params.nextStatus === "cancelled") && (params.syncContext.executionPolicy !== null || params.syncContext.executionState !== null);
|
|
@@ -8973,6 +8982,24 @@ async function updatePaperclipIssueState(ctx, params) {
|
|
|
8973
8982
|
});
|
|
8974
8983
|
if (!payloadResult.failure) {
|
|
8975
8984
|
issueUpdated = true;
|
|
8985
|
+
if (issuePatch.executionState === null && ctx.issues && typeof ctx.issues.update === "function") {
|
|
8986
|
+
try {
|
|
8987
|
+
await ctx.issues.update(
|
|
8988
|
+
issueId,
|
|
8989
|
+
{ executionState: null },
|
|
8990
|
+
companyId
|
|
8991
|
+
);
|
|
8992
|
+
} catch (error) {
|
|
8993
|
+
issueUpdated = false;
|
|
8994
|
+
ctx.logger.warn("GitHub sync could not clear Paperclip issue execution state after the local API update. Falling back to direct issue mutation.", {
|
|
8995
|
+
companyId,
|
|
8996
|
+
issueId,
|
|
8997
|
+
paperclipApiBaseUrl,
|
|
8998
|
+
nextStatus,
|
|
8999
|
+
error: getErrorMessage(error)
|
|
9000
|
+
});
|
|
9001
|
+
}
|
|
9002
|
+
}
|
|
8976
9003
|
}
|
|
8977
9004
|
if (payloadResult.failure && (payloadResult.failure.status ?? response.status) !== 404 && (payloadResult.failure.status ?? response.status) !== 405) {
|
|
8978
9005
|
logPaperclipIssueStatusUpdateFailure(ctx, {
|