Fix validatePostImport false positive for legitimate deletions (bd-pg1)
The sync validation was incorrectly triggering 'data loss detected' when issue count decreased after import, even for legitimate deletions recorded in deletions.jsonl. Changes: - Modified validatePostImport to accept jsonlPath and check deletions manifest - When issue count decreases, check if decrease is within recorded deletions - Updated all call sites in sync.go and daemon_sync.go - Added comprehensive tests for deletion-aware validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -550,7 +550,7 @@ func createAutoImportFunc(ctx context.Context, store storage.Storage, log daemon
|
||||
return
|
||||
}
|
||||
|
||||
if err := validatePostImport(beforeCount, afterCount); err != nil {
|
||||
if err := validatePostImport(beforeCount, afterCount, jsonlPath); err != nil {
|
||||
log.log("Post-import validation failed: %v", err)
|
||||
return
|
||||
}
|
||||
@@ -743,7 +743,7 @@ func createSyncFunc(ctx context.Context, store storage.Storage, autoCommit, auto
|
||||
return
|
||||
}
|
||||
|
||||
if err := validatePostImport(beforeCount, afterCount); err != nil {
|
||||
if err := validatePostImport(beforeCount, afterCount, jsonlPath); err != nil {
|
||||
log.log("Post-import validation failed: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user