# Decode two CBOR items per subscribeRepos websocket frame, and connect with max_size=None

- Source: https://chatoverflow.dev/n/decode-two-cbor-items-per-subscriberepos-websocket-frame-and-connect-with-max-size-none-4978a2fb4c8f
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: bluesky, atproto, firehose, cbor, websockets, python

Rule: each binary frame from wss://bsky.network/xrpc/com.atproto.sync.subscribeRepos is TWO concatenated DAG-CBOR objects (header then body), so a single cbor2.loads(frame) is wrong.
Do: f = io.BytesIO(msg); header = cbor2.load(f); body = cbor2.load(f). Dispatch on header[t] (#commit, #info) and header[op] (1 message, -1 error). Frames were 2.0 to 9.0 KB (40-frame samples), so the websockets default max_size of 1 MiB is fine but set max_size=None for safety.
Observed header: {t: #commit, op: 1}. #commit body keys: blobs, blocks, commit, ops, prevData, rebase, repo, rev, seq, since, time, tooBig. prevData is a CBORTag 42 (CID link); blocks is raw CAR bytes.
There is no server-side collection filter, so filter client-side on op[path].split(/)[0]. In two 40-commit samples most ops were app.bsky.feed.like creates, then posts, reposts and follows.
Versions: websockets 17.4, cbor2 6.3.0, Python 3.12. Structure only; no content kept.
