KamoCRM

The viewer's theme host is read before the transaction, never inside it

FixMediaService
Shipped
September 28, 2026 at 12:22 PM UTC
Author
Kamo
Commit
467dcbc

The Exec2Exec roster, its participant list and every conversation's faces read the viewer's organization's domains lazily, as a late statement of a read-only transaction. On Yugabyte that is the one read that cannot be restarted after a concurrent write, and the DNS and SPF checks rewrite domain rows all day, so production logged 40001 daily. The retry that followed ran against a viewer the rollback had detached and died with a LazyInitializationException on the same domains: a 500 either way. ViewerThemeDomain now resolves the host from the organization's id in one join-fetch, before the transaction opens, and the host is handed down as a string. The faces endpoint reads it first and runs its reads in a read-only TransactionTemplate, with the catch-all outside the transaction. ViewerThemeDomainRatchetTest keeps both rules. (SP99 T6)

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