Preserve typed ObjectState history across restarts - #5
Conversation
|
👀 Human Input Needed → Pair Review Briefing |
| # Or save to file | ||
| ObjectStateRegistry.save_history_to_file("history.json") | ||
| ObjectStateRegistry.load_history_from_file("history.json") | ||
| ObjectStateRegistry.save_history_to_file("history.objectstate") |
There was a problem hiding this comment.
The README example now points users at history.objectstate, but docs/undo_redo.rst still documents save_history_to_file() / load_history_from_file() as JSON persistence. That generated documentation will describe the removed JSON contract after this PR, which can mislead users into treating the new dill file as portable JSON.
Severity: low
🤖 Was this useful? React with 👍 or 👎
|
|
||
|
|
||
| def _reset_registry_history() -> None: | ||
| ObjectStateRegistry._snapshots.clear() |
There was a problem hiding this comment.
This helper leaves the typed_history ObjectState registered in ObjectStateRegistry._states, so later tests in the same process can capture it in unrelated snapshots or import histories against the wrong scope set. Because the registry is global and conftest.py does not reset it between tests, this persistence test can make the suite order-dependent.
Severity: medium
🤖 Was this useful? React with 👍 or 👎
Summary
Verification