A library for ATProtocol identities.

fix: bug in multiple jetstream collections

Signed-off-by: Nick Gerakines <nick.gerakines@gmail.com>

Changed files
+10 -20
crates
atproto-jetstream
+10 -20
crates/atproto-jetstream/src/consumer.rs
··· 261 // Add requireHello parameter 262 query_params.push(format!("requireHello={}", self.config.require_hello)); 263 264 - // Add wantedCollections if specified 265 - if !self.config.collections.is_empty() { 266 - let collections = self 267 - .config 268 - .collections 269 - .iter() 270 - .map(|c| urlencoding::encode(c)) 271 - .collect::<Vec<_>>() 272 - .join(","); 273 - query_params.push(format!("wantedCollections={}", collections)); 274 } 275 276 - // Add wantedDids if specified 277 - if !self.config.dids.is_empty() { 278 - let dids = self 279 - .config 280 - .dids 281 - .iter() 282 - .map(|d| urlencoding::encode(d)) 283 - .collect::<Vec<_>>() 284 - .join(","); 285 - query_params.push(format!("wantedDids={}", dids)); 286 } 287 288 // Add maxMessageSizeBytes if specified
··· 261 // Add requireHello parameter 262 query_params.push(format!("requireHello={}", self.config.require_hello)); 263 264 + // Add wantedCollections if specified (each collection as a separate query parameter) 265 + if !self.config.collections.is_empty() && !self.config.require_hello { 266 + for collection in &self.config.collections { 267 + query_params.push(format!("wantedCollections={}", urlencoding::encode(collection))); 268 + } 269 } 270 271 + // Add wantedDids if specified (each DID as a separate query parameter) 272 + if !self.config.dids.is_empty() && !self.config.require_hello { 273 + for did in &self.config.dids { 274 + query_params.push(format!("wantedDids={}", urlencoding::encode(did))); 275 + } 276 } 277 278 // Add maxMessageSizeBytes if specified