Recently I shipped cupertino v1.0.1 with "verified zero duplicate pairs across 405,782 rows."

Today v1.0.2 removed 128,142 of those rows. They had been duplicates the whole time.

The v1.0.1 verification query was structurally incapable of seeing the bug: URIs carry a hash suffix computed before lowercasing, so GROUP BY LOWER(uri) was lowercasing two already-different strings.

Full write-up:
https://aleahim.com/blog/cupertino-v1-0-2/

#Swift #SQLite #iOSDev

Cupertino v1.0.2: the duplicate that `LOWER(uri)` could not see - Aleahim

A third of the search index was the same Apple page indexed twice. The verification query that "proved" it wasn't could not have seen the bug. What v1.0.2 ships, and three takeaways from the audit.