fix(storage): normalize timestamps to UTC to prevent validation failures (#1123)

All time.Now() calls in the dolt storage layer now use time.Now().UTC()
to ensure consistent timezone handling. Previously, timestamps could be
stored with mixed timezone formats (UTC 'Z' vs local '+01:00'), causing
bv validation to fail when updated_at appeared earlier than created_at
in absolute time.

Files modified:
- transaction.go: CreateIssue, UpdateIssue, CloseIssue
- issues.go: CreateIssue, CreateIssues, UpdateIssue, CloseIssue, markDirty, manageClosedAt
- rename.go: UpdateIssueID (2 locations)
- events.go: AddIssueComment (2 locations)
- dirty.go: SetExportHash
- queries.go: Overdue filter, GetStaleIssues

Fixes: bd-84gw9

Co-authored-by: LoomDeBWiles <loomenwiles@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
LoomDeBWiles
2026-01-15 22:22:50 -05:00
committed by GitHub
parent 490e9f695f
commit c40affd601
6 changed files with 16 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ func (s *DoltStore) UpdateIssueID(ctx context.Context, oldID, newID string, issu
UPDATE issues
SET id = ?, title = ?, description = ?, design = ?, acceptance_criteria = ?, notes = ?, updated_at = ?
WHERE id = ?
`, newID, issue.Title, issue.Description, issue.Design, issue.AcceptanceCriteria, issue.Notes, time.Now(), oldID)
`, newID, issue.Title, issue.Description, issue.Design, issue.AcceptanceCriteria, issue.Notes, time.Now().UTC(), oldID)
if err != nil {
return fmt.Errorf("failed to update issue ID: %w", err)
}
@@ -68,7 +68,7 @@ func (s *DoltStore) UpdateIssueID(ctx context.Context, oldID, newID string, issu
INSERT INTO dirty_issues (issue_id, marked_at)
VALUES (?, ?)
ON DUPLICATE KEY UPDATE marked_at = VALUES(marked_at)
`, newID, time.Now())
`, newID, time.Now().UTC())
if err != nil {
return fmt.Errorf("failed to mark issue dirty: %w", err)
}