KamoCRM

A send looks up its AI turn limit and its sender's photo before its transaction opens

FixMediaService
Shipped
29 செப்டம்பர், 2026 அன்று 12:28 AM UTC
Author
Kamo
Commit
434cb44

SP98-D-5 and D-9. A chat send asked SecurityService for an AI member's charter limit (up to 1 s + 2 s) inside the open send transaction, and read the sender organization's domain rows for the photo URL after the message's INSERT - a late read YugabyteDB cannot restart, which lost two sends to 'Restart read required' (2026-09-26 03:04 and 09:31 UTC). - AiTurnGuard.limitFor(sender) is asked before the transaction; admit(session, sender, limit) only counts inside it and refuses an AI whose limit was not resolved first. - MediaController.createMessage opens its own transaction (TransactionTemplate) after both lookups; its catch-all sits outside it, so a send that fails after its INSERT is rolled back before its 500 instead of committing the message the client will retry. - Exec2ExecService.post reads the limit, then posts in its transaction. - SenderAvatars builds the photo URL from ViewerThemeDomain (one join-fetch) and the avatar re-read by id, outside any transaction. OrgDomainResolver had no caller left and is removed.

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