Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **fix(protocol):** Hash trimmed tags so spaces around `||` do not prevent matching messages in the Broker ([#12920](https://github.com/mxsm/rocketmq-rust/issues/12920)).
- **fix(protocol):** Decode IPv4 and IPv6 offset message IDs with the surrounding whitespace accepted by validation ([#12889](https://github.com/mxsm/rocketmq-rust/issues/12889)).
- **fix(filter):** Preserve UTF-8 text and escaped apostrophes in SQL92 string literals ([#12850](https://github.com/mxsm/rocketmq-rust/issues/12850)).
- **fix(admin-tui):** Keep the confirmation cursor and mismatch highlighting aligned when wide characters scroll out of view ([#12824](https://github.com/mxsm/rocketmq-rust/issues/12824)).
Expand Down
11 changes: 7 additions & 4 deletions rocketmq-protocol/src/protocol/filter/filter_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ impl FilterAPI {
}

for tag in tags {
let trimmed_tag = tag.trim();
if !trimmed_tag.is_empty() {
subscription_data.tags_set.insert(trimmed_tag.into());
let tag = tag.trim();
if !tag.is_empty() {
subscription_data.tags_set.insert(tag.into());
subscription_data.code_set.insert(JavaStringHasher::hash_str(tag));
}
}
Expand Down Expand Up @@ -99,13 +99,16 @@ mod tests {
#[test]
fn build_subscription_data_creates_correct_subscription_data() {
let topic = "test_topic".into();
let sub_string = "tag1||tag2".into();
let sub_string = "tag1 || tag2".into();
let subscription_data = FilterAPI::build_subscription_data(&topic, &sub_string).unwrap();

assert_eq!(subscription_data.topic.as_str(), topic.as_str());
assert_eq!(subscription_data.sub_string.as_str(), sub_string.as_str());
assert!(subscription_data.tags_set.contains("tag1"));
assert!(subscription_data.tags_set.contains("tag2"));
for tag in ["tag1", "tag2"] {
assert!(subscription_data.code_set.contains(&JavaStringHasher::hash_str(tag)));
}
}

#[test]
Expand Down
Loading