Highly ambitious ATProtocol AppView service and sdks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

restore lexicon filtering logic

+28 -4
+28 -4
api/src/database/records.rs
··· 255 255 // Build ORDER BY clause with datetime field information 256 256 let order_by = build_order_by_clause_with_field_info(sort_by, primary_field_is_datetime); 257 257 258 - where_clauses.push(format!("slice_uri = ${}", param_count)); 258 + let is_lexicon = where_clause 259 + .as_ref() 260 + .and_then(|wc| wc.conditions.get("collection")) 261 + .and_then(|c| c.eq.as_ref()) 262 + .and_then(|v| v.as_str()) 263 + == Some("network.slices.lexicon"); 264 + 265 + if is_lexicon { 266 + where_clauses.push(format!("json->>'slice' = ${}", param_count)); 267 + } else { 268 + where_clauses.push(format!("slice_uri = ${}", param_count)); 269 + } 259 270 param_count += 1; 260 271 261 272 // Build all other WHERE conditions first (including collection filter) 262 - // Exclude the 'slice' field since we handle it via slice_uri 273 + // For non-lexicon records, exclude the 'slice' field since we handle it via slice_uri 263 274 let mut filtered_where_clause = None; 264 275 let filtered_clause; 265 276 266 - if let Some(wc) = where_clause { 277 + if is_lexicon { 278 + filtered_where_clause = where_clause; 279 + } else if let Some(wc) = where_clause { 267 280 let mut filtered_conditions = std::collections::HashMap::new(); 268 281 for (field, condition) in &wc.conditions { 269 282 if field != "slice" { ··· 359 372 let mut where_clauses = Vec::new(); 360 373 let mut param_count = 1; 361 374 362 - where_clauses.push(format!("slice_uri = ${}", param_count)); 375 + let is_lexicon = where_clause 376 + .as_ref() 377 + .and_then(|wc| wc.conditions.get("collection")) 378 + .and_then(|c| c.eq.as_ref()) 379 + .and_then(|v| v.as_str()) 380 + == Some("network.slices.lexicon"); 381 + 382 + if is_lexicon { 383 + where_clauses.push(format!("json->>'slice' = ${}", param_count)); 384 + } else { 385 + where_clauses.push(format!("slice_uri = ${}", param_count)); 386 + } 363 387 param_count += 1; 364 388 365 389 let (and_conditions, or_conditions) =