mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-06 23:20:53 +01:00
fix(heartbeat): skip retries for promoted comment wakes
This commit is contained in:
1 parent
783e9727c4
commit
38add6ebb9
2 files changed
+14
-2
No files matched your search
@@ -262,7 +262,7 @@ describe("heartbeat comment wake batching", () => {
|
||||
payloadTemplate: {
|
||||
message: "wake now",
|
||||
},
|
||||
waitTimeoutMs: 2_000,
|
||||
waitTimeoutMs: 10_000,
|
||||
},
|
||||
runtimeConfig: {},
|
||||
permissions: {},
|
||||
@@ -455,7 +455,7 @@ describe("heartbeat comment wake batching", () => {
|
||||
payloadTemplate: {
|
||||
message: "wake now",
|
||||
},
|
||||
waitTimeoutMs: 2_000,
|
||||
waitTimeoutMs: 10_000,
|
||||
},
|
||||
runtimeConfig: {},
|
||||
permissions: {},
|
||||
|
||||
@@ -2062,6 +2062,9 @@ export function heartbeatService(db: Db) {
|
||||
) {
|
||||
const contextSnapshot = parseObject(run.contextSnapshot);
|
||||
const issueId = readNonEmptyString(contextSnapshot.issueId);
|
||||
const isPromotedDeferredCommentWake =
|
||||
readNonEmptyString(contextSnapshot.wakeReason) === "issue_execution_promoted" &&
|
||||
extractWakeCommentIds(contextSnapshot).length > 0;
|
||||
if (!issueId) {
|
||||
if (run.issueCommentStatus !== "not_applicable") {
|
||||
await patchRunIssueCommentStatus(run.id, {
|
||||
@@ -2073,6 +2076,15 @@ export function heartbeatService(db: Db) {
|
||||
return { outcome: "not_applicable" as const, queuedRun: null };
|
||||
}
|
||||
|
||||
if (isPromotedDeferredCommentWake) {
|
||||
await patchRunIssueCommentStatus(run.id, {
|
||||
issueCommentStatus: "not_applicable",
|
||||
issueCommentSatisfiedByCommentId: null,
|
||||
issueCommentRetryQueuedAt: null,
|
||||
});
|
||||
return { outcome: "not_applicable" as const, queuedRun: null };
|
||||
}
|
||||
|
||||
const postedComment = await findRunIssueComment(run.id, run.companyId, issueId);
|
||||
if (postedComment) {
|
||||
await patchRunIssueCommentStatus(run.id, {
|
||||
|
||||
Reference in new issue
Block a user