Cosmos: Expose/manage SessionToken
- Dominant language
- F#
- Stars
- 501
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
The default CosmosDb consistency level (Session) involves round-tripping a [`SessionToken` value](https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-manage-consistency#utilize-session-tokens) between the outcome of a given request through to its successors(s) in order to achieve Read-Your-Writes.
Necessary steps off the top of my head:
- grabbing (probably inside the stored proc too?), the token from the response
- propagating it (likely stashing it in the Cosmos.Token alongside the etag etc, although the way the DocDb client holds the value will probably be sufficient in this local case) outward with the response
- exposing it in the processing context for both `Query` and `Transact` options (similarly to how the `Version` is exposed to `QueryEx`; if it's to go there, it likely makes sense to provide a `Context` record bearing both of those - having `Version` available for the `Transact` side is currently not covered)
cc @thednaz
Contributor guide
Assessment
This issue has not been assessed yet.