You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
db: ORM restore (is_deleted True→False) and ORM primary-key changes leave no audit record #811
Restore: setting a trashed row's is_deleted from True to False and flushing. Soft-delete columns are excluded from ordinary diffs, and the lifecycle branch only handles is_deleted=True.
Primary-key change: assigning a new PK to a loaded object and flushing. _column_diffs excludes primary keys on UPDATE as well as on create.
The statement-DML paths for both already produce records. Only the unit-of-work path misses them.
Restore: with audited, add and flush SoftDeleteItem(title="x", is_deleted=True), clear the recorder, set is_deleted=False, flush. Result: recorder.records == [].
PK change: load an AuditTestItem, set id=999, flush. Result: no record.
Suggested fix
Emit a restored lifecycle record when is_deleted goes from True to False, matching the DML path. Include the PK old/new pair in UPDATE diffs (exclude PKs only on create).
Found in a full review of simple_module_db (main @ 7a5c860).
Activity
fix(db,audit_log): bulk audit prefetch keeps loader criteria; ORM res…
antosubash commentedon Nov 4, 2026
Fixed in #821 (squash-merged as 0fcd877).