feat(FN-5485): clear userPaused state on manual retry reset with regression
Adds retry-reset logic that clears the user-paused flag on tasks, ensuring they can resume automatically after a retry is triggered, with regression tests covering the behavior across the CLI extension and core manual-reset module. Fusion-Task-Id: FN-5485
This commit is contained in:
committed by
gsxdsm
parent
2d661df870
commit
4b484fd818
@@ -35,4 +35,14 @@ describe("buildManualRetryResetPatch", () => {
|
||||
it("clears nextRecoveryAt", () => {
|
||||
expect(buildManualRetryResetPatch()).toMatchObject({ nextRecoveryAt: null });
|
||||
});
|
||||
|
||||
it("clears userPaused for manual retry in all modes", () => {
|
||||
const defaultPatch = buildManualRetryResetPatch();
|
||||
expect(Object.prototype.hasOwnProperty.call(defaultPatch, "userPaused")).toBe(true);
|
||||
expect(defaultPatch.userPaused).toBeUndefined();
|
||||
|
||||
const mergePatch = buildManualRetryResetPatch({ resetMergeRetries: true });
|
||||
expect(Object.prototype.hasOwnProperty.call(mergePatch, "userPaused")).toBe(true);
|
||||
expect(mergePatch.userPaused).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,9 +16,11 @@ export const MANUAL_RETRY_RESET_COUNTER_KEYS = [
|
||||
"mergeAuditBounceCount",
|
||||
] as const satisfies ReadonlyArray<keyof Task>;
|
||||
|
||||
/** Resets retry/recovery counters and clears `userPaused` for explicit manual retries. */
|
||||
export function buildManualRetryResetPatch(options?: { resetMergeRetries?: boolean }): Partial<Task> {
|
||||
const patch: Partial<Task> = {
|
||||
nextRecoveryAt: null as unknown as Task["nextRecoveryAt"],
|
||||
userPaused: undefined,
|
||||
};
|
||||
|
||||
for (const key of MANUAL_RETRY_RESET_COUNTER_KEYS) {
|
||||
|
||||
Reference in New Issue
Block a user