Install
Works with Drupal: ^11.3 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
This release adds a database table and ships no update hook. Uninstall and reinstall Audit Trail rather than updating in place: a site that only pulls the new code will fatal on the first audited write, because the default write mode stages into a table that does not exist yet.
Audit entries written during a save are no longer lost
Issue 3620300. An audit entry written inside a caller's open transaction could not be serialised by the per-chain write lock, because the head it reads to link itself is bound to that transaction's snapshot. Two overlapping writers read the same head, the no-fork unique key refused the second row, and that entry was lost. Chain integrity was never at risk; completeness was. A long caller transaction also stalled every concurrent chain write behind it.
Such an entry is now chained when the caller's transaction commits, so it lands instead of being dropped. By default it waits in the new audit_trail_outbox table, which makes it atomic with the change it describes and survives a crash before the flush.
Where it waits is the new Entries recorded during a save setting on the Audit Trail settings page. A site that needs a failed audit write to be able to abort the caller can keep the previous behaviour, and the entries it loses, by choosing to record entries immediately.
Two entries were added to the status report: audit entries waiting to be recorded, and, when entries are recorded immediately, how many were written that way during a save.
For modules that write audit entries
An entry written inside a transaction is not readable until that transaction commits, which matters most to tests: assert after the commit, not before. A caller that rolls back a savepoint should discard what it buffered, via the new markPendingWrites() and discardPendingWritesSince() on AuditTrailInterface; callers that do not use savepoints have nothing to do.
Also in this release
- Issue 3620302: a log call on a channel no chain claims no longer builds any chain entity, so the cost of the logger short-circuit no longer scales with the number of chains configured. The same issue fixes the codebase metrics page counting production and test lines differently depending on which version of cloc produced it.
- Issue 3620254: the metrics page reported the number of service definition keys rather than the number of services.
- Issue 3620250: CHANGELOG.md is gone. It duplicated these notes and the issue queue, and shipped stale inside earlier tags.
- Issue 3620299: the architecture and front pages no longer describe a chain row as embedding the previous row's HMAC, which is not how the code builds it.