Pin down bucketOf and unreadForRow against a repeat

Testkamo-internal
Ya
26 Agosti 2026, 04:03 UTC
Mwandishi
kamo
Ahadi ya
2801501

This file just shipped four silent defects in one review round — an AI row that fell through to the wrong bucket, a title that was never read off the row, a bucket missing from the persisted-preference allowlist, and an unread computation that (as an earlier draft of it stood) would have zeroed every SOCIAL row's badge — none of which a typecheck or a build would have caught. There was no test on this file at all, before or after. bucketOf and the row-unread ternary were already pure and already side-effect-free; they just were not reachable from a test. Both are now exported, and the unread ternary is lifted out to unreadForRow verbatim — the call site is a single delegating line, and the branching itself is untouched. ALL_BUCKETS is exported too, for the one-line assertion that 'ai' is actually in it. The SOCIAL regression test was checked the way a guard against a specific past mistake should be: by reintroducing that mistake. Dropping the `row.sessionType === 'SOCIAL' ||` clause (i.e. routing SOCIAL through the live sessions map, exactly what the plan's own unreadFor() example did) made exactly one of the fourteen new tests fail — this one, with the planted decoy value instead of row.unreadCount — and left the other thirteen green. Reverted immediately after.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei