Files
twenty/packages
sonarly-bot 9ba3015f0b fix(server): keep participant matching on active transaction manager
https://sonarly.com/issue/38297?type=bug

Message import jobs can fail during participant matching with `QueryRunnerAlreadyReleasedError`, interrupting Gmail sync for affected workspaces.

Fix: Implemented the transactional fix in `MessagingMessageParticipantService` to prevent participant matching from running through a nested `executeInWorkspaceContext` when an existing `transactionManager` is already provided.

What changed:
- Refactored `saveMessageParticipants()` to:
  - execute repository reads/inserts using the provided `transactionManager` when present,
  - run matching in the same path,
  - only use `executeInWorkspaceContext` when no transaction manager is provided.
- Also ensured the initial deduplication `find(...)` uses the same `transactionManager` for consistency with insert/match operations.

Why this addresses the root cause:
- The failing path mixed nested workspace context + inherited transaction manager usage.
- This change keeps the operation aligned with the active transactional boundary from the caller, removing the fragile manager lifecycle crossing that led to `QueryRunnerAlreadyReleasedError`.

Authored by Sonarly by autonomous analysis (run 43706).
2026-05-18 08:29:07 +00:00
..
2026-05-04 11:09:34 +02:00
2026-05-18 10:20:30 +02:00