Issue Bug Closed

#110588Workspace stage change and publish history entries carry no correlation id

Benni Mack 09/01/26, 19:28 updated 09/08/26, 10:03

Description

Workspaces\Hook\DataHandlerHook::getRecordHistoryStore() builds the RecordHistoryStore without the DataHandler’s CorrelationId, and none of its three call sites pass one either — changeStageForRecord() in version_setStage() and the two publishRecord() calls in version_swap()
and publishNewRecord().

RecordHistoryStore::createCorrelationId() therefore falls back to CorrelationId::forSubject(md5($table . ':' . $uid)), which has no scope.

Observed for one workspace edit, followed by a stage change and a publish:

#1  ADD      tt_content:3  ws=1  scope=OQfCAxitYP0G8xJFEgjjkRTQKh-Qn1KU
#2  ADD      tt_content:1  ws=1  scope=OQfCAxitYP0G8xJFEgjjkRTQKh-Qn1KU
#3  MODIFY   tt_content:1  ws=1  scope=OQfCAxitYP0G8xJFEgjjkRTQKh-Qn1KU
#4  ADD      tt_content:5  ws=1  scope=OQfCAxitYP0G8xJFEgjjkRTQKh-Qn1KU
#5  STAGE    tt_content:1  ws=1  scope=<none>
#6  PUBLISH  tt_content:1  ws=0  scope=<none>

(Rows #2, #3 and #5 were written for the workspace version uid 4 and repointed to the live uid 1 by the publish.)

Two effects:

  • Stage changes and publishes cannot be correlated with the operation that caused them. A “publish all” of 40 records writes 40 rows that cannot be tied back to that one action.
  • The fallback id is deterministic and constant per record, so every stage change and every publish of the same record shares one correlation_id for the record’s entire lifetime. RecordHistory::findEventsForCorrelation() returns all of them at once, mixed across unrelated operations.

Regular DataHandler operations are unaffected: a single run that creates, modifies, moves and deletes records already writes every entry under the
correlation scope of the outermost instance.

Expected: pass the DataHandler CorrelationId into getRecordHistoryStore() and on to all three calls.

Reviews 2

History 25

  1. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-02T13:10:10+00:00" > 09/02/26, 13:10 </span>

    Applied in changeset commit:7d7d6f23e4dad292eb6a03bfdc7a681c35eb3db9.