Automations and webhooks for the AT Protocol airglow.run

New automations run on events from before they were created #8

Closed there-hugo.dev
Closed opened by there-hugo.dev

Problem #

A freshly created automation executes on Jetstream events that predate it.

Likely path (not traced end to end):

  • lib/jetstream/handler.ts:160-200 never compares event.time_us with the automation's creation or activation time. isCatchUpEvent (handler.ts:560) only throttles.
  • Adding a collection reconnects the subscription (lib/jetstream/consumer.ts:339-381), which resumes from lastSeenTimeUs or the stored cursor (consumer.ts:500-531). The cursor key is the DID set only (consumer.ts:903), and lookback is up to 1h (lib/config.ts:158).
  • Dedupe is keyed on (automationUri, sourceUri) (lib/jetstream/dedupe.ts), so a new automation has no history to dedupe against.

Seen in the session #

In https://www.youtube.com/watch?v=5MnT-ZgbBIc:

  • 0:50:30 and 1:09:30: events about 12 minutes older than the automation.
  • 1:33:30: 7 events from 7:03 to 7:23 PM all executed within one second at 7:28:39, right after creation, plus one live event. They included creates of follows that had since been deleted, which produced 8 list items for one real follow. "I did not follow eight people."

Fix direction #

  • Skip events whose time_us is older than the automation's creation (or last activation) time.
  • Add a test that a reconnect replay doesn't fire a newly created automation.

Details: docs/brainstorms/2026-10-17-graze-conference-automation-feedback.md (B4).

Fixed in 7f04c98: newly subscribed automations no longer receive events from before they joined.

Sign up or Sign in to add to the discussion.