commits
- /health now returns {status, lastFigmaRequestAt} as JSON. the
timestamp is written on every authenticated figma POST via a
reserved `__`-prefixed key in the existing KV namespace, so
monitoring can detect upstream silence without a figma PAT.
- discord 401/404 short-circuit the retry and drop immediately.
the webhook is dead; retrying wastes the single retry slot.
- discord 429 honors retry-after, clamped to [60s, 10min],
instead of the fixed 5min. still bounded by MAX_FLUSH_ATTEMPTS.
- log discord response body (truncated to 500 chars) on non-2xx
so 4xx vs 5xx vs rate-limit is obvious in `bun run tail`.
- promote no-KV-mapping log to warn and include file_name plus
triggered_by.handle for attribution.
- log zero-item flushes (deletion-only publishes) instead of
silently dropping.
- self-heal past alarms in batcher: treat alarms with `< now` as
absent so a stale alarm can't starve new batches.
typecheck passes. no new deps, no new bindings, no state shape
changes.
Signed-off-by: eti <eti@eti.tf>
Cloudflare Worker that relays Figma LIBRARY_PUBLISH events to a Discord
channel webhook. uses a Durable Object per file_key to coalesce the
separate per-asset-type events Figma emits into a single batched Discord
embed within a 60s window, with a single retry on Discord failure.
Signed-off-by: eti <eti@eti.tf>
- /health now returns {status, lastFigmaRequestAt} as JSON. the
timestamp is written on every authenticated figma POST via a
reserved `__`-prefixed key in the existing KV namespace, so
monitoring can detect upstream silence without a figma PAT.
- discord 401/404 short-circuit the retry and drop immediately.
the webhook is dead; retrying wastes the single retry slot.
- discord 429 honors retry-after, clamped to [60s, 10min],
instead of the fixed 5min. still bounded by MAX_FLUSH_ATTEMPTS.
- log discord response body (truncated to 500 chars) on non-2xx
so 4xx vs 5xx vs rate-limit is obvious in `bun run tail`.
- promote no-KV-mapping log to warn and include file_name plus
triggered_by.handle for attribution.
- log zero-item flushes (deletion-only publishes) instead of
silently dropping.
- self-heal past alarms in batcher: treat alarms with `< now` as
absent so a stale alarm can't starve new batches.
typecheck passes. no new deps, no new bindings, no state shape
changes.
Signed-off-by: eti <eti@eti.tf>
Cloudflare Worker that relays Figma LIBRARY_PUBLISH events to a Discord
channel webhook. uses a Durable Object per file_key to coalesce the
separate per-asset-type events Figma emits into a single batched Discord
embed within a 60s window, with a single retry on Discord failure.
Signed-off-by: eti <eti@eti.tf>