Skip to content
Astera Technology

Handle a webhook that arrives after newer state

Use an authoritative revision or current read instead of assuming arrival order is business order.

Record the ordering evidence you actually have

Stripe does not guarantee delivery in generation order. Its event creation time is not a safe deduplication or ordering key. This synthetic example instead assumes a local source explicitly supplies a monotonic revision per record.

Synthetic revision decisions
Stored revisionIncomingDecision
12; inactiveRevision 11; activeDo not overwrite revision 12
12; inactiveRevision 13; approved reactivationApply according to lifecycle policy
No reliable revisionTwo events with same timestampRead authoritative current state
Download editable CSV ↓

Handle a missing prerequisite without guessing

If a child event arrives before its parent, queue the dependency or retrieve the parent through a documented read. Keep the event identity so retries do not create a second child. An unavailable read leaves the task pending rather than inventing the parent.

Can comparing two second-resolution timestamps resolve their order?

Show the worked answer

Not if they tie or the source does not guarantee the ordering semantics. Use the source’s supported version/current-state mechanism and preserve both event identities.

Related resources