- Ya
- 2 Septemba 2026, 05:54 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 170823a
The index is written from two directions. Opening a message runs the full indexer, which writes the row and then computes its search_vector. Listing a folder writes an envelope row long before that, and computed nothing — so the row was in the table and invisible to search, which matches on search_vector and on nothing else. That is most of the mail. In production search_vector was set on 113 of 547 rows: every row created before 2026-08-14 had one, and most created after did not, which is this listing path arriving. A member searching a folder whose mail was in front of them matched nothing in the index, and SearchService fell through to its IMAP fallback — the "(via IMAP)" this whole thread started from. The envelope has no body and body_text stays empty for it, which was the right call and is not what was broken. The vector is built from subject, sender, sender name and recipients too, and an envelope carries all four, so the message becomes findable by the things people actually search for and gains its body when the full indexer runs. Refreshed for every uid on the page rather than only the newly inserted ones, so the 434 rows written before this existed repair themselves as their folders are browsed. Verified against the live database inside a transaction that was rolled back: three rows that had no vector were given one, and afterwards matched to_tsquery for words in their own subjects and not for words absent from them.