fix: dedupe compares bytes to characters, so every Unicode body appended a duplicate #51
Reference in New Issue
Block a user
Delete Branch "fix/dedupe-byte-length"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while verifying the BookOrbit ingester: a second sweep reported 0 new and still wrote 18 rows.
Bug
RecordObservationdecided "unchanged" withFor TEXT, SQLite's
LENGTH()counts characters. Any body containing an em dash, a curly quote or any non-ASCII text therefore never matched its stored length, so the hash check was skipped and a duplicate observation was appended — with an identical content hash, on every sweep.The BookOrbit entry hit it immediately: 6511 characters vs 6578 bytes.
Blast radius
Rows vs distinct
(fingerprint, content_hash)in the live index:This is most of what #43 is about, and it was growing every ticker interval.
Fix
LENGTH(CAST(content AS BLOB))— SQLite counts bytes, matching Go.Tests
Not done here
No cleanup of the existing duplicates — that is a destructive pass over the log and belongs with #43, where the numbers above are now recorded.