MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / updateWebhookEvent

Function updateWebhookEvent

apps/web/src/lib/integrations/db/webhook-events.ts:56–74  ·  view source on GitHub ↗
(
  eventId: string,
  updates: {
    processed: boolean;
    processed_at: string;
    handlers_triggered: string[];
    errors: Array<{ message: string; handler: string; stack?: string }> | null;
  }
)

Source from the content-addressed store, hash-verified

54
55/**
56 * Claims a delivery signature for `event`. Returns false when another delivery
57 * already holds it. A concurrent claim of the same signature waits for this
58 * transaction, so if the event insert that follows fails and the transaction
59 * rolls back, the delivery can be claimed again on retry.
60 */
61export async function claimWebhookEventSignature(
62 tx: DrizzleTransaction,
63 eventSignature: string,
64 event: WebhookEventRef
65): Promise<boolean> {
66 const claimed = await tx
67 .insert(webhook_event_signatures)
68 .values({
69 event_signature: eventSignature,
70 webhook_event_id: event.id,
71 webhook_event_created_at: event.createdAt,
72 })
73 .onConflictDoNothing({ target: webhook_event_signatures.event_signature })
74 .returning({ eventSignature: webhook_event_signatures.event_signature });
75 return claimed.length > 0;
76}
77

Callers 2

handleGitHubWebhookFunction · 0.90
POSTFunction · 0.90

Calls 2

setMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected