Fix: Treat same-ID updates as normal updates, not collisions (bd-0134cc5a)

This commit is contained in:
Steve Yegge
2025-10-31 13:39:38 -07:00
parent 932b293118
commit eb18d342f4

View File

@@ -206,24 +206,12 @@ func handleCollisions(ctx context.Context, sqliteStore *sqlite.SQLiteStorage, is
result.CollisionIDs = append(result.CollisionIDs, collision.ID)
}
// Handle collisions - with hash IDs, collisions shouldn't happen
// With hash IDs, "collisions" (same ID, different content) are actually UPDATES
// Hash IDs are based on creation content and remain stable across updates
// So same ID + different fields = normal update operation, not a collision
// The collisionResult.Collisions list represents issues that will be updated
if len(collisionResult.Collisions) > 0 {
// Hash-based IDs make collisions extremely unlikely (same ID = same content)
// If we get here, it's likely a bug or manual ID manipulation
return nil, fmt.Errorf("collision detected for issues: %v (this should not happen with hash-based IDs)", result.CollisionIDs)
// Remove colliding issues from the list (they're already processed)
filteredIssues := make([]*types.Issue, 0)
collidingIDs := make(map[string]bool)
for _, collision := range collisionResult.Collisions {
collidingIDs[collision.ID] = true
}
for _, issue := range issues {
if !collidingIDs[issue.ID] {
filteredIssues = append(filteredIssues, issue)
}
}
return filteredIssues, nil
result.Updated = len(collisionResult.Collisions)
}
// Phase 4: Renames removed - obsolete with hash IDs (bd-8e05)