KamoCRM

A release that keeps someone the note already named no longer fails with 500

FixKBService
Shipped
October 12, 2026 at 4:04 AM UTC
Author
Kamo
Commit
1b103a6

The release reads the note's current NAMED audience before it writes, and the request keeps one persistence context (open-in-view), so those note_audience_members rows are managed when NoteReleaseWriter replaces the audience. Its JPQL bulk DELETE does not evict them, and persisting a row with the same key then threw EntityExistsException: re-releasing a NAMED note to anyone it already named (a new sensitivity, a wider or narrower set) answered 500 and changed nothing. Found live by KamoCollab CP05 Task 40 in sp00verify. replaceAudience detaches the rows the context holds before the bulk delete. NoteReleaseWriterAudienceTest runs it over a real Hibernate session on H2 (red before: EntityExistsException, as in production).

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