{"record":{"id":"52c16a2c7bbf3f23","repo":"clockworklabs/SpacetimeDB","slug":"subscription-with-id-query-set-id-already-exis","errorCode":null,"errorMessage":"Subscription with id {query_set_id:?} already exists for client: {client_id:?}","messagePattern":"Subscription with id (.+?) already exists for client: (.+?)","errorType":"exception","errorClass":"DBError::Other","httpStatus":null,"severity":"error","filePath":"crates/core/src/subscription/module_subscription_manager.rs","lineNumber":985,"sourceCode":"            .clients\n            .get(&client_id)\n            .is_some_and(|ci| ci.dropped.load(Ordering::Acquire))\n        {\n            self.remove_all_subscriptions(&client_id);\n        }\n        let ci = Self::get_or_make_client_info_and_inform_send_worker(\n            &mut self.clients,\n            &self.send_worker_queue,\n            client_id,\n            client,\n        );\n\n        #[cfg(test)]\n        ci.assert_ref_count_consistency();\n        let subscription_id = (client_id, query_set_id);\n        let hash_set = match ci.v2_subscriptions.try_insert(subscription_id, HashSet::new()) {\n            Err(OccupiedError { .. }) => {\n                return Err(anyhow::anyhow!(\n                    \"Subscription with id {query_set_id:?} already exists for client: {client_id:?}\"\n                )\n                .into());\n            }\n            Ok(hash_set) => hash_set,\n        };\n\n        // We track the queries that are being added for this client.\n        let mut new_queries: Vec<Arc<Plan>> = Vec::new();\n\n        for query in &queries {\n            let hash = query.hash();\n            // Deduping queries within this single call.\n            if !hash_set.insert(hash) {\n                continue;\n            }\n            let query_state = self\n                .queries","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/core/src/subscription/module_subscription_manager.rs#L967-L1003","documentation":"Error \"Subscription with id {query_set_id:?} already exists for client: {client_id:?}\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/core/src/subscription/module_subscription_manager.rs:985 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}