Fix bugs in snapshot stripping: auto-note, mass update, DB-off, fallback
- _auto_change_note now loads previous snapshot from DB instead of reading stripped in-memory node (was producing wrong commit messages) - _render_mass_update now strips snapshots after save (was leaking RAM) - Only strip snapshots when DB is enabled (preview/restore still works without DB via in-memory or disk fallback) - _render_data_preview adds disk fallback matching _restore_node Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -619,6 +619,14 @@ def _render_data_preview(nid, htree, state: AppState = None, file_path=None):
|
||||
df = state.db.get_data_file_by_names(state.current_project, file_path.stem)
|
||||
if df:
|
||||
node_data = state.db.get_node_snapshot(df['id'], nid)
|
||||
if not node_data and file_path:
|
||||
# Disk fallback: read snapshot from JSON file
|
||||
try:
|
||||
raw_data, _ = load_json(file_path)
|
||||
tree_on_disk = raw_data.get(KEY_HISTORY_TREE, {})
|
||||
node_data = tree_on_disk.get('nodes', {}).get(nid, {}).get('data')
|
||||
except Exception:
|
||||
pass
|
||||
if not node_data:
|
||||
ui.label('Snapshot data not available.').classes('text-caption text-warning')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user