From a76e56f3093143821b9152e5dea6bf9498170f7c Mon Sep 17 00:00:00 2001 From: Nasr Date: Sun, 7 Jul 2024 12:09:52 +0200 Subject: [PATCH] refactor: empty hashed keys in subscription match all entities --- crates/torii/grpc/src/server/subscriptions/entity.rs | 2 +- crates/torii/grpc/src/server/subscriptions/event_message.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index 79666a170a..d58c55969e 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -109,7 +109,7 @@ impl Service { // matches the key pattern of the subscriber. match &sub.keys { Some(EntityKeysClause::HashedKeys(hashed_keys)) => { - if !hashed_keys.contains(&hashed) { + if !hashed_keys.is_empty() && !hashed_keys.contains(&hashed) { continue; } } diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 5e6c249129..9074800dd9 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -108,7 +108,7 @@ impl Service { // matches the key pattern of the subscriber. match &sub.keys { Some(EntityKeysClause::HashedKeys(hashed_keys)) => { - if !hashed_keys.contains(&hashed) { + if !hashed_keys.is_empty() && !hashed_keys.contains(&hashed) { continue; } }