Forum teuk.org

Stricter hostmask matching and safer SQL handling

in Mediabot · started by TeuK · 3w ago

TeuK · 3w ago

A new cleanup and hardening pass just landed in mediabot_v3.

Commit:
⚡ Stupefy fuzzy matches: unified hostmask magic and taught Mediabot stricter SQL spells

This round was focused on reliability rather than flashy features.

What changed

  • unified hostmask matching logic instead of keeping several slightly different implementations
  • improved autologin consistency across the codebase
  • made user resolution more deterministic when multiple masks could overlap
  • replaced a number of overly permissive LIKE queries with strict equality where exact matches were clearly intended
  • reduced a few unnecessary SELECT * queries in sensitive paths

Why it matters

A lot of subtle bugs in IRC bots do not come from spectacular failures. They come from small differences in how identity, authentication, and matching are handled in different parts of the code.

The goal of this work was to reduce that ambiguity:

  • one clearer hostmask strategy
  • fewer fuzzy SQL checks where exact identity was expected
  • more predictable behavior overall

Current status

So far, the updated code starts cleanly and behaves correctly in live checks.

This is not the end of the cleanup work, but it is an important step toward making mediabot_v3 more consistent, easier to maintain, and less likely to surprise me later.

You must be logged in to reply.