Reject cross-org sales agents; widen bootstrap cache busting

FixMediaService
Shipped
July 19, 2026 at 1:45 AM UTC
Author
Kamo
Commit
a3625c3

salesAgentId was persisted from the request body unchecked, so a cross-org or dangling agent id could be stored on a WebChatIntegration. It failed safe only because AIService reads the agent back with an org-scoped lookup - the data was wrong, and the blast radius happened to be contained by a check in a different service. That is a fragile place to leave an authorization boundary, so it is now enforced at the write: an id this org does not own is rejected outright. Also widens bootstrap cache invalidation from {designConfig, enabled} to every field the widget bootstrap actually serves (aiEnabled, humanEnabled, salesAgentId, assignmentMode, name). The cache is an unimplemented no-op today so the narrow list was harmless, but it would have become a silent staleness bug the moment the cache was populated - a widget serving the previous agent or routing mode, with no obvious cause.

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