diff --git a/rust/property-defs-rs/src/app_context.rs b/rust/property-defs-rs/src/app_context.rs index 36f07217fa1ef..bcb12910fefd1 100644 --- a/rust/property-defs-rs/src/app_context.rs +++ b/rust/property-defs-rs/src/app_context.rs @@ -92,13 +92,13 @@ impl AppContext { continue; }; // If we didn't find a group type, we have nothing to resolve. - let Some(GroupType::Unresolved(name)) = &update.group_type_index else { + let Some(GroupType::Unresolved(group_name)) = &update.group_type_index else { continue; }; - let name = format!("{}:{}", update.team_id, name); + let cache_key = format!("{}:{}", update.team_id, group_name); - let cached = self.group_type_cache.get(&name); + let cached = self.group_type_cache.get(&cache_key); if let Some(index) = cached { update.group_type_index = update.group_type_index.take().map(|gti| gti.resolve(index)); @@ -109,14 +109,14 @@ impl AppContext { let found = sqlx::query_scalar!( "SELECT group_type_index FROM posthog_grouptypemapping WHERE group_type = $1 AND team_id = $2", - name, + group_name, update.team_id ) .fetch_optional(&self.pool) .await?; if let Some(index) = found { - self.group_type_cache.insert(name, index); + self.group_type_cache.insert(cache_key, index); update.group_type_index = update.group_type_index.take().map(|gti| gti.resolve(index)); } else {