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-18 02:48:13 -08:00
2025-12-14 17:21:44 -08:00
2025-12-14 17:21:44 -08:00
2025-12-05 16:20:43 -08:00
2025-12-18 02:48:13 -08:00
2025-12-17 19:10:13 -08:00
2025-12-17 19:10:13 -08:00
2025-12-17 19:10:13 -08:00
2025-12-05 15:48:46 -08:00
2025-12-16 06:29:59 +01:00
2025-12-16 13:26:51 -08:00
2025-12-16 13:26:51 -08:00
2025-12-16 13:26:51 -08:00
2025-12-18 02:48:13 -08:00
2025-12-14 17:23:46 -08:00
2025-12-16 01:06:14 -08:00
2025-12-18 19:26:29 +01:00
2025-12-17 19:10:13 -08:00
2025-12-18 02:48:13 -08:00
2025-12-16 13:06:47 -08:00
2025-12-18 02:48:13 -08:00
2025-12-07 20:34:02 +11:00
2025-12-18 02:48:13 -08:00
2025-12-16 01:06:14 -08:00
2025-12-18 02:48:13 -08:00
2025-12-18 02:48:13 -08:00
2025-12-18 02:48:13 -08:00
2025-12-14 12:40:32 -08:00
2025-12-16 13:19:22 -08:00
2025-12-16 06:29:59 +01:00
2025-12-14 00:37:54 -08:00
2025-12-14 14:18:01 -08:00
2025-12-18 02:48:13 -08:00
2025-12-05 15:41:35 -08:00