Skip to content

Commit

Permalink
refactor: empty hashed keys in subscription match all entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jul 7, 2024
1 parent 2e04f54 commit a76e56f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/torii/grpc/src/server/subscriptions/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 112 in crates/torii/grpc/src/server/subscriptions/entity.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/server/subscriptions/entity.rs#L112

Added line #L112 was not covered by tests
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 111 in crates/torii/grpc/src/server/subscriptions/event_message.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/server/subscriptions/event_message.rs#L111

Added line #L111 was not covered by tests
continue;
}
}
Expand Down

0 comments on commit a76e56f

Please sign in to comment.