KamoCRM

Recover a lost background count from the images themselves

FixSecurityService
Shipped
26 ஆகஸ்ட், 2026 அன்று 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?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing