Files
Bohan-J 5c0d39a709 fix(issues): run the channel-media merge when status and description change together (MUL-4809)
A request that changed BOTH status and description took the status-write branch
exclusively, so it skipped updateIssueWithDescriptionMerge and dropped channel
media that had landed after the editor's base. The branch chain assumed the two
never travel together — an assumption, not a guarantee: the API accepts both in
one payload, and nothing rejects it.

Split the merge body out as mergeIssueDescriptionParams so it can run against
the caller's transaction, and invoke it from inside the status-lock transaction
when the request also carries a description. Both writes now commit atomically
in ONE transaction (the status lock still guards resolve+write against a
concurrent archive migration) instead of needing two.

Closed on both the single-update and batch paths. Batch passes a nil base for
the same reason the description-only batch path does: one batch-level base
cannot describe multiple documents, so media is preserved conservatively.

Adds two regressions that fail against the previous code with "channel media
dropped by a combined status+description update" and pass with the fix.

Co-authored-by: multica-agent <github@multica.ai>
2026-08-08 11:44:46 +08:00
..