Marco Del Pin
dba9bb91c3
fix(import): handle duplicate issue IDs in JSONL files gracefully
Implements three-layer deduplication strategy to prevent UNIQUE
constraint errors during import:
1. Early deduplication during processing (importer.go)
2. Pre-batch deduplication (importer.go)
3. INSERT OR IGNORE with explicit error handling (issues.go)
**Problem:**
JSONL files with duplicate issue IDs caused import failures:
Import failed: UNIQUE constraint failed: issues.id
**Root Cause:**
- Go SQLite driver returns errors even with INSERT OR IGNORE
- Only content hash was deduplicated, not IDs
- Multiple code paths affected (insertIssue, insertIssues)
**Solution:**
Layer 1: Early deduplication by ID in upsertIssues (lines 489-502)
Layer 2: Pre-batch deduplication (lines 713-726)
Layer 3: INSERT OR IGNORE + isUniqueConstraintError() helper
**Testing:**
- Multiple production databases tested
- 9 duplicates handled successfully
- 100% success rate on v0.30.5 databases
- Zero UNIQUE constraint errors
**Impact:**
- Enables importing JSONL with duplicate IDs
- Duplicate count shown in import statistics
- No breaking changes, backward compatible
🤖 Generated with Claude Code
2025-12-18 19:26:29 +01:00
..
2025-12-05 13:22:09 -08:00
2025-12-14 22:18:10 -08:00
2025-12-16 18:13:33 -08:00
2025-12-03 22:44:59 -08:00
2025-12-13 12:50:33 -08:00
2025-12-14 22:36:51 -08:00
2025-12-16 22:38:45 -08:00
2025-12-18 19:26:29 +01:00
2025-12-14 15:21:29 -08:00
2025-12-16 22:35:29 -08:00
2025-12-18 02:48:13 -08:00
2025-12-18 19:26:29 +01:00
2025-12-16 14:20:49 -08:00
2025-12-18 02:48:13 -08:00
2025-12-16 13:19:22 -08:00
2025-12-16 01:07:55 -08:00