fix: preserve pinned field during JSONL import (bd-phtv)
Fixed two code paths where pinned=false from JSONL would overwrite existing pinned=true in database: - importer.go: Only update pinned if explicitly true in JSONL - multirepo.go: Use COALESCE to preserve existing pinned value Added tests for pinned field preservation. Note: Bug may have additional code path - investigation ongoing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -567,8 +567,11 @@ func upsertIssues(ctx context.Context, sqliteStore *sqlite.SQLiteStorage, issues
|
||||
updates["acceptance_criteria"] = incoming.AcceptanceCriteria
|
||||
updates["notes"] = incoming.Notes
|
||||
updates["closed_at"] = incoming.ClosedAt
|
||||
// Pinned field (bd-7h5)
|
||||
updates["pinned"] = incoming.Pinned
|
||||
// Pinned field (bd-phtv): Only update if explicitly true in JSONL
|
||||
// (omitempty means false values are absent, so false = don't change existing)
|
||||
if incoming.Pinned {
|
||||
updates["pinned"] = incoming.Pinned
|
||||
}
|
||||
|
||||
if incoming.Assignee != "" {
|
||||
updates["assignee"] = incoming.Assignee
|
||||
@@ -662,8 +665,11 @@ func upsertIssues(ctx context.Context, sqliteStore *sqlite.SQLiteStorage, issues
|
||||
updates["acceptance_criteria"] = incoming.AcceptanceCriteria
|
||||
updates["notes"] = incoming.Notes
|
||||
updates["closed_at"] = incoming.ClosedAt
|
||||
// Pinned field (bd-7h5)
|
||||
updates["pinned"] = incoming.Pinned
|
||||
// Pinned field (bd-phtv): Only update if explicitly true in JSONL
|
||||
// (omitempty means false values are absent, so false = don't change existing)
|
||||
if incoming.Pinned {
|
||||
updates["pinned"] = incoming.Pinned
|
||||
}
|
||||
|
||||
if incoming.Assignee != "" {
|
||||
updates["assignee"] = incoming.Assignee
|
||||
|
||||
Reference in New Issue
Block a user