feat: stale-file protection — detect concurrent edits on save #15
Reference in New Issue
Block a user
Delete Branch "feat/4-stale-file-protection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #4. Detects when the config file changed on disk between load and save (e.g.,
claude mcp addin a terminal, a second BCC window, or Claude Code writing~/.claude.json), then prompts the user with a merge-or-overwrite dialog.config_mtime(path)— lightweight mtime check helperexternal_change_summary(original_cfg, path)— returns the list of top-level keys that changed on disk plus a masked server-section diff (reuses_server_sectionsextracted frombackup_diff)MainWindow._loaded_mtime— recorded atload_profile(), refreshed after every successful writeStaleDialog— shows changed key names and masked server diff; offers Merge & save (apply user server edits on top of current disk state, keeping external non-server changes) or Overwrite anywayTest plan
python -m pytest)ruff checkandruff format --checkcleanclaude mcp addin terminal, save in BCC → StaleDialog appearsnumStartups) takes the disk value🤖 Generated with Claude Code