{"record":{"id":"e8550ba39246702d","repo":"clockworklabs/SpacetimeDB","slug":"unexpected-compressed-v1-update-for-v2-subscribe","errorCode":null,"errorMessage":"unexpected compressed v1 update for v2 subscribe","messagePattern":"unexpected compressed v1 update for v2 subscribe","errorType":"exception","errorClass":"DBError::Other","httpStatus":null,"severity":"error","filePath":"crates/core/src/subscription/module_subscription_actor.rs","lineNumber":260,"sourceCode":"        physical_plans.insert(hash, compiled.physical_plans);\n        compiled_queries.insert(hash, plan.clone());\n        plans.push(plan);\n        *new_queries += 1;\n    }\n}\n\nfn query_rows_from_update(\n    update: ws_v1::DatabaseUpdate<ws_v1::BsatnFormat>,\n    use_deletes: bool,\n) -> Result<ws_v2::QueryRows, DBError> {\n    let tables = update\n        .tables\n        .into_iter()\n        .flat_map(|table_update| {\n            let table_name = table_update.table_name;\n            table_update.updates.into_iter().map(move |single_update| {\n                let ws_v1::CompressableQueryUpdate::Uncompressed(query_update) = single_update else {\n                    return Err(DBError::Other(anyhow::anyhow!(\n                        \"unexpected compressed v1 update for v2 subscribe\"\n                    )));\n                };\n                let rows = if use_deletes {\n                    query_update.deletes\n                } else {\n                    query_update.inserts\n                };\n                Ok(ws_v2::SingleTableRows {\n                    table: table_name.clone(),\n                    rows,\n                })\n            })\n        })\n        .collect::<Result<Vec<_>, DBError>>()?;\n\n    Ok(ws_v2::QueryRows {\n        tables: tables.into_boxed_slice(),","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/9e0d92412ff2248f401a8ad12d535f2b5ac30912/crates/core/src/subscription/module_subscription_actor.rs#L242-L278","documentation":"query_rows_from_update converts a v1 DatabaseUpdate into v2 QueryRows for the v2 websocket protocol and only handles CompressableQueryUpdate::Uncompressed. Receiving a compressed update means the v1 evaluation pipeline produced compressed row sets for a client that negotiated the v2 (binary, uncompressed) protocol. This is an internal server-side invariant violation, not a client error.","triggerScenarios":"A v2 subscribe or unsubscribe with row delivery flowing through evaluate_queries while the update pipeline has compression enabled - the Compressed variant reaches a code path that only understands Uncompressed.","commonSituations":"Server builds or configs with update compression toggled on while v2 clients connect; experimental branches; internal protocol tests.","solutions":["Update the SpacetimeDB server to a version where v2 clients never receive compressed updates","Disable update compression in server configuration if it was enabled experimentally","Report it with logs - this indicates a protocol-layer bug, not a usage mistake"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match subscription_result {\n    Err(DBError::Other(e)) if e.to_string().contains(\"unexpected compressed v1 update for v2 subscribe\") => {\n        // Server-side protocol bug: log context, disconnect cleanly, and report to the server operators\n    }\n    other => other,\n}","preventionTips":["Keep client and server on matched released versions","Do not enable update compression on servers serving v2 clients","Capture protocol negotiation details in logs to speed up bug reports"],"tags":["spacetimedb","subscriptions","v2-protocol","compression","internal-invariant"],"backgroundTag":"protocol-format-mismatch","analyzedSha":"9e0d92412ff2248f401a8ad12d535f2b5ac30912","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}