Recover a lost background count from the images themselves

FixSecurityService
Shipped
August 26, 2026 at 5:24 AM UTC
Author
Kamo
Commit
34fabaf

commitBackgroundOrder writes the images to STAGING, and imageBgCount is only a record of how many it wrote — which made that one column a single point of failure. An org whose count went missing had three staged images that nothing would look at: provisioning copied none of them, every surface read "no backgrounds", and the cleanup pass then removed the public copies as surplus. The images sat in staging the whole time. An absent count is now recovered by counting what is staged, contiguously from slot 1 — the layout commitBackgroundOrder writes. A real zero is untouched: an org that genuinely has none has an empty staging area and answers 0 either way. Read-only; repairing the column belongs to whoever next commits an order, because a wrong guess written back is permanent. With the earlier NULL-is-not-zero guard this closes the loop: a missing count can no longer destroy a customer's backgrounds, and no longer hides them either.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing