Skip to content

Case insensitive lookups for qname in pebble database#157

Open
zluudg wants to merge 1 commit intomainfrom
leon/issues/156/case-insensitive-pebble-lookup
Open

Case insensitive lookups for qname in pebble database#157
zluudg wants to merge 1 commit intomainfrom
leon/issues/156/case-insensitive-pebble-lookup

Conversation

@zluudg
Copy link
Contributor

@zluudg zluudg commented Feb 4, 2026

Summary by CodeRabbit

  • Bug Fixes
    • DNS question names are now consistently lowercased and made UTF-8 safe before cache checks, inserts, and disk storage, ensuring case-insensitive deduplication and consistent persistence.
    • Event emissions now use the same normalized qname, improving reliability and consistency of downstream processing and deduplication.

@zluudg zluudg requested a review from a team as a code owner February 4, 2026 11:22
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

DNS question names are normalized to lowercase (and UTF-8-validated in protocols) before cache lookups, inserts, and on-disk storage, making cache and persistence operations case-insensitive.

Changes

Cohort / File(s) Summary
Runner: cache & storage normalization
pkg/runner/runner.go
Lowercases DNS question names before LRU cache (qnameSeen) and Pebble database (pdb.Get/pdb.Set) operations; replaces direct use of msg.Question[0].Name with the normalized value.
Protocol event creation
pkg/protocols/protocols.go
Imports strings and sets event Qname to strings.ToLower(strings.ToValidUTF8(msg.Question[0].Name, "")), ensuring UTF‑8 safety and lowercase normalization when creating NewQnameEvent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble on names with a careful hop,
I stitch UTF‑8 seams and lower the top,
Tuck Qnames in order, no case left to fight,
Caches and disks hum together at night. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing case-insensitive DNS question name (qname) lookups in the Pebble database by normalizing qnames to lowercase across cache and storage operations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch leon/issues/156/case-insensitive-pebble-lookup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zluudg zluudg requested a review from morkrost February 4, 2026 11:23
Clean and case-insensitive qname in JSON struct sent north
@zluudg zluudg force-pushed the leon/issues/156/case-insensitive-pebble-lookup branch from c238bd0 to 9655b96 Compare February 4, 2026 12:39
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.

1 participant