KamoCRM

Load history images via query, not lazy getImages() (WS path)

FixAIService
Shipped
17 ஜூலை, 2026 அன்று 8:26 AM UTC
Author
Kamo
Commit
c7d0181

**************** runs on the WebSocket path (called from AiChatWebSocketHandler), which is NOT an HTTP request, so open-session-in-view does not apply. Iterating the loaded history and touching msg.getImages() (a LAZY @OneToMany) on those detached entities threw LazyInitializationException ("could not initialize proxy - no Session"), which surfaced to the client as the assistant reply — breaking every AI chat send. Fetch the images with the existing **************** query instead, so they load in their own session. (The HTTP history endpoint keeps working via OSIV.)

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