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
From the client perspective, after the request has finished, the {txnId} value should be changed by for the next request (how is not specified; a monotonically increasing integer is recommended).
Recently two developers have encountered issues with transaction IDs ([1], [2]). In both cases, it turned out they had followed the recommendation from the spec and used a plain monotonically increasing integer as the transaction ID. Counting from 0 means there are conflicts whenever the counter resets, and persisting counters is error-prone. The first case had a persistence bug, the second case was creating a new access token on each startup, but MSC3970 broke that by changing transaction ID scope from access token to device ID.
Something like concatenating the current timestamp with a monotonically increasing integer would be a much safer recommendation.
The text was updated successfully, but these errors were encountered:
Personally using version 4 GUIDs as tnxIds, I'd say anything that can be reasonably guaranteed to be unique would be a fairly safe recommendation.
Perhaps alternatives could be listed in the spec?
In https://spec.matrix.org/v1.9/client-server-api/#transaction-identifiers the spec says (emphasis mine)
Recently two developers have encountered issues with transaction IDs ([1], [2]). In both cases, it turned out they had followed the recommendation from the spec and used a plain monotonically increasing integer as the transaction ID. Counting from 0 means there are conflicts whenever the counter resets, and persisting counters is error-prone. The first case had a persistence bug, the second case was creating a new access token on each startup, but MSC3970 broke that by changing transaction ID scope from access token to device ID.
Something like concatenating the current timestamp with a monotonically increasing integer would be a much safer recommendation.
The text was updated successfully, but these errors were encountered: