chore: remove invalid race condition bug risk #11 from PLAN.md

Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-09 23:24:26 -03:00
parent 6804429c9f
commit 2be895fea5

View File

@@ -78,11 +78,4 @@
- `src/modes/diff.rs: mode_diff()``validate_diff_args()`, `setup_diff_pipes()`, `spawn_writer_threads()`, `execute_diff_command()`, `handle_diff_output()`
- `src/modes/diff.rs: write_item_to_pipe()``open_item_reader()`, `copy_item_data()`
## Specific Bug Risks
### 11. Race Conditions
**Files affected:** `src/db.rs`, `src/modes/save.rs`
**Functions affected:** `insert_item()`, `mode_save()`
**Problem example:** While SQLite uses file locking, multiple processes could still create items with same auto-increment ID if they begin transactions simultaneously before the lock is acquired, leading to potential file overwrites when using `item_id.to_string()` as filename
**Fix example:** Use database-level unique constraints and handle conflicts gracefully, or use UUIDs for filenames instead of auto-increment IDs