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:
@@ -198,7 +198,7 @@ func (s *DoltStore) SearchIssues(ctx context.Context, query string, filter types
|
||||
}
|
||||
if filter.Overdue {
|
||||
whereClauses = append(whereClauses, "due_at IS NOT NULL AND due_at < ? AND status != ?")
|
||||
args = append(args, time.Now().Format(time.RFC3339), types.StatusClosed)
|
||||
args = append(args, time.Now().UTC().Format(time.RFC3339), types.StatusClosed)
|
||||
}
|
||||
|
||||
whereSQL := ""
|
||||
@@ -402,7 +402,7 @@ func (s *DoltStore) GetEpicsEligibleForClosure(ctx context.Context) ([]*types.Ep
|
||||
|
||||
// GetStaleIssues returns issues that haven't been updated recently
|
||||
func (s *DoltStore) GetStaleIssues(ctx context.Context, filter types.StaleFilter) ([]*types.Issue, error) {
|
||||
cutoff := time.Now().AddDate(0, 0, -filter.Days)
|
||||
cutoff := time.Now().UTC().AddDate(0, 0, -filter.Days)
|
||||
|
||||
statusClause := "status IN ('open', 'in_progress')"
|
||||
if filter.Status != "" {
|
||||
|
||||
Reference in New Issue
Block a user