An Elixir atproto Jetstream V2 subscriber library

Introduce support for zstd compression #27

Merged jola.dev
targeting main
Merged opened by and assigned to jola.dev
targeting main

Rather than bringing in an outside nif dependency, this uses the OTP 28 built-in :zstd module. Also in the interest of not bringing in more dependencies, the dictionary fetching is done using Mint.HTTP, even if it's a bit messy to write.

Jetstream V2 compression uses zstd and a pre-defined dictionary. This dictionary probably doesn't change much, but it can change, and so by design fetching it should happen at startup. Kite enables compression by passing zstdDictionary: <id> as a query param when connecting to the websocket. If the dictionary version does not match, the server rejects with a 400 and we re-fetch the dictionary (this could happen during fail over or after running for a longer period of time).

This commit introduces tests for both the compression path, and the fallback when OTP 28 is not available. CI runs on OTP 27 and 29, ensuring both paths are verified.

This pull request has no versions submitted yet.