-
Notifications
You must be signed in to change notification settings - Fork 239
Description
What problem does your feature solve?
The getEvents API reference describes the id field in the response as:
Unique identifier for this event, based on the TOID format. It combines a 19-character TOID and a 10-character, zero-padded event index, separated by a hyphen.
This describes the format of the ID, of which much can be inferred, but for developers building on the API it would be ideal if the doc stated the properties of the id explicitly. So it is really clear what they can and can't rely on.
For example:
- Ordering: The
idis used as a cursor for pagination and is lexicographically ordered, meaning events can be sorted byidto get chronological order. This is important for developers building event streaming or indexing systems, but it's not stated. - Stability: Is the event
idfor a given event stable across protocol versions? If a developer stores event IDs for deduplication or tracking, will they remain valid after protocol upgrades? - Other properties?
Without these properties being explicitly documented, developers have to infer them.
This becomes even more critical if core workflows using the RPC will require developers to sort events themselves, which is something being discussed here:
What would you like to see?
Explicitly document the properties of the id field in the getEvents response. For example:
- State that the
idis ordered — events with a higheridoccurred later, andidvalues can be compared lexicographically to determine order. The docs also need to say how that works in the context of parallel execution on network. - Clarify whether the
idis stable across protocol versions — i.e. whether the same event will always produce the sameidregardless of protocol upgrades. - Any other guarantees or caveats about the
idthat developers should know about.
What alternatives are there?
- Developers can infer the ordering property from the fact that
idis used as a pagination cursor, but this is implicit and not a documented guarantee. - Developers can read the RPC server source code to understand the TOID construction, but this shouldn't be necessary for an API consumer.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status