Skip to content

Fix SearchKeysAsync database selection and RemoveByTagAsync tag cleanup#652

Merged
imperugo merged 1 commit into
masterfrom
fix/issues-650-651
May 22, 2026
Merged

Fix SearchKeysAsync database selection and RemoveByTagAsync tag cleanup#652
imperugo merged 1 commit into
masterfrom
fix/issues-650-651

Conversation

@imperugo
Copy link
Copy Markdown
Owner

Summary

  • SearchKeysAsync was using raw IServer.ExecuteAsync("SCAN") which always defaults to database 0, ignoring the database number from Db1, Db2, etc. Replaced with IServer.KeysAsync(database, pattern, pageSize) which correctly targets the specified database. Fixes SearchKeysAsync ignores database number #651
  • RemoveByTagAsync deleted all data keys referenced by a tag but never deleted the tag Set key itself (tag:{tagName}), causing empty Sets to accumulate in Redis indefinitely. Now deletes the tag key after removing its members. Fixes Tags are not disposed of #650
  • Bumped version to 12.2.0

Test plan

  • New test SearchKeysAsync_Should_Respect_Database_Number_Async — writes keys to DB1, verifies SearchKeys on DB1 returns only DB1 keys
  • New test RemoveByTagAsync_ShouldDeleteTagKey_Async — verifies tag Set key is deleted after RemoveByTagAsync
  • Full test suite passes: 972/972 on both net9.0 and net10.0

… cleaning up tag keys (#651, #650)

SearchKeysAsync was using IServer.ExecuteAsync("SCAN") which always scans DB0.
Replaced with IServer.KeysAsync(database, pattern) which correctly targets the specified database.

RemoveByTagAsync was deleting tagged data keys but not the tag Set key itself,
leaving empty Sets in Redis indefinitely. Now deletes the tag key after removing its members.

Bumped version to 12.2.0.
@imperugo imperugo merged commit 6237aea into master May 22, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearchKeysAsync ignores database number Tags are not disposed of

1 participant