mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 19:20:39 +09:00
Reduce run lifecycle toast noise
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
0356040a29
commit
2fea39b814
2 changed files with 79 additions and 3 deletions
|
|
@ -244,8 +244,8 @@ function shouldSuppressAgentStatusToastForVisibleIssue(
|
|||
}
|
||||
|
||||
const ISSUE_TOAST_ACTIONS = new Set(["issue.created", "issue.updated", "issue.comment_added"]);
|
||||
const AGENT_TOAST_STATUSES = new Set(["running", "error"]);
|
||||
const TERMINAL_RUN_STATUSES = new Set(["succeeded", "failed", "timed_out", "cancelled"]);
|
||||
const AGENT_TOAST_STATUSES = new Set(["error"]);
|
||||
const RUN_TOAST_STATUSES = new Set(["failed", "timed_out", "cancelled"]);
|
||||
|
||||
function describeIssueUpdate(details: Record<string, unknown> | null): string | null {
|
||||
if (!details) return null;
|
||||
|
|
@ -416,7 +416,7 @@ function buildRunStatusToast(
|
|||
const runId = readString(payload.runId);
|
||||
const agentId = readString(payload.agentId);
|
||||
const status = readString(payload.status);
|
||||
if (!runId || !agentId || !status || !TERMINAL_RUN_STATUSES.has(status)) return null;
|
||||
if (!runId || !agentId || !status || !RUN_TOAST_STATUSES.has(status)) return null;
|
||||
|
||||
const error = readString(payload.error);
|
||||
const triggerDetail = readString(payload.triggerDetail);
|
||||
|
|
@ -653,6 +653,8 @@ function handleLiveEvent(
|
|||
}
|
||||
|
||||
export const __liveUpdatesTestUtils = {
|
||||
buildAgentStatusToast,
|
||||
buildRunStatusToast,
|
||||
invalidateActivityQueries,
|
||||
shouldSuppressActivityToastForVisibleIssue,
|
||||
shouldSuppressRunStatusToastForVisibleIssue,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue