fix(versioning): replace session-state guard with InvalidRequestError catch
The previous attempt (d0520f6766) was too aggressive: skipping when parent is in session.dirty/new/deleted bypassed the persistent-and-clean case the hook EXISTS for. Some upstream code paths put the dataset in session.dirty *before* this listener fires (API controllers touching audit fields, etc.), so the session-membership pre-check made us silently no-op on the very scenario the hook needs to handle. CI symptom: test_dataset_column_edit_creates_parent_version showed before=317, after=317 (parent shadow not written). Restore the unconditional flag_modified and catch the specific InvalidRequestError that fires only for the session.new case (uuid default callable hasn't populated state yet). Other states fall through to the original behavior: - persistent + clean → flag_modified succeeds, parent goes dirty, Continuum picks it up, SkipUnmodifiedPlugin keeps the row via _has_dirty_versioned_children. ✓ - persistent + dirty → flag_modified is harmless (already dirty). - session.new → InvalidRequestError, skip (parent INSERTs anyway). - session.deleted → flag_modified may or may not raise; if it does, we skip; if not, the delete dominates. Should unblock test_dataset_column_edit_creates_parent_version, test_get_version_returns_historical_snapshot_with_children, and test_restore_with_column_edits_reverts_columns.
M
Mike Bridge committed
a0193dbab682aff7e9d2c618d256fc7e70e1f4d5
Parent: 4c99cd6