Fix LiveRunWidget activeRun merge bug and add idle_warning clear test
- Fix: activeRun merge in LiveRunWidget was dropping errorCode and lastOutputAt, preventing idle badge and last-output display from rendering for active runs - Add test: verify reportRunActivity clears idle_warning error code and updates lastOutputAt Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
d747d847e4
commit
b3bccf3648
2 changed files with 20 additions and 0 deletions
|
|
@ -332,4 +332,22 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => {
|
|||
expect(run?.errorCode).toBeNull();
|
||||
expect(run?.error).toBeNull();
|
||||
});
|
||||
|
||||
it("clears the idle warning when the run reports activity again", async () => {
|
||||
const { runId } = await seedRunFixture({
|
||||
includeIssue: false,
|
||||
runErrorCode: "idle_warning",
|
||||
runError: "Idle warning: no output for 10 minutes",
|
||||
});
|
||||
const heartbeat = heartbeatService(db);
|
||||
|
||||
const updated = await heartbeat.reportRunActivity(runId);
|
||||
expect(updated?.errorCode).toBeNull();
|
||||
expect(updated?.error).toBeNull();
|
||||
expect(updated?.lastOutputAt).toBeTruthy();
|
||||
|
||||
const run = await heartbeat.getRun(runId);
|
||||
expect(run?.errorCode).toBeNull();
|
||||
expect(run?.error).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) {
|
|||
agentId: activeRun.agentId,
|
||||
agentName: activeRun.agentName,
|
||||
adapterType: activeRun.adapterType,
|
||||
errorCode: activeRun.errorCode,
|
||||
lastOutputAt: toIsoString(activeRun.lastOutputAt),
|
||||
issueId,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue