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:
@@ -68,7 +68,7 @@ func (s *DoltStore) AddIssueComment(ctx context.Context, issueID, author, text s
|
||||
result, err := s.db.ExecContext(ctx, `
|
||||
INSERT INTO comments (issue_id, author, text, created_at)
|
||||
VALUES (?, ?, ?, ?)
|
||||
`, issueID, author, text, time.Now())
|
||||
`, issueID, author, text, time.Now().UTC())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to add comment: %w", err)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func (s *DoltStore) AddIssueComment(ctx context.Context, issueID, author, text s
|
||||
IssueID: issueID,
|
||||
Author: author,
|
||||
Text: text,
|
||||
CreatedAt: time.Now(),
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user