You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you'd like to listen to an event from all collections use wildcard `*` for the `collectionSlug` parameter.
173
173
174
+
# Event Versioning
175
+
176
+
Every stream event includes a numeric `version` field that is **monotonically increasing per source entity**. Use it to handle out-of-order event delivery: when two events arrive for the same entity, the one with the higher `version` is the newer state.
177
+
178
+
## Version scale depends on event type
179
+
180
+
The backend emits whichever authoritative monotonic counter exists for the underlying entity, so the *scale* of `version` varies:
181
+
182
+
| Event types |`version` semantic |
183
+
| --- | --- |
184
+
|`item_listed`, `item_cancelled`, `item_received_offer`, `item_received_bid`, `collection_offer`, `trait_offer`, `order_invalidate`, `order_revalidate`| Order revision counter (small monotonic integer per order) |
185
+
|`item_transferred`, `item_sold`, `item_metadata_updated`| Epoch milliseconds of the event's source timestamp |
186
+
187
+
Both representations are monotonic and sufficient for resolving out-of-order delivery, but the two scales are **not comparable to each other**. Never compare `version` across different event families or across unrelated entities — only compare versions for the same entity within the same event family.
188
+
189
+
## Usage
190
+
191
+
Scope your stored versions by event type (or by the source entity — order id for order-derived events, nft_id for item events):
// Otherwise discard — we already have newer state for this order
204
+
});
205
+
```
206
+
207
+
Multiple backend pods process events, DLQ replays can deliver older state, and normal Kafka processing can deliver events out of order. Comparing `version` within the same entity lets consumers always converge to the correct current state.
208
+
174
209
# Types
175
210
176
211
Types are included to make working with our event payload objects easier.
0 commit comments