Repository navigation
fix: Walmart order failed to load with an order_date Scan error - #116
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
==========================================
+ Coverage 66.88% 66.91% +0.03%
==========================================
Files 53 53
Lines 7453 7460 +7
==========================================
+ Hits 4985 4992 +7
Misses 2111 2111
Partials 357 357
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
modernc.org/sqlite writes time.Time with time.Time.String by default. For a time in an unnamed fixed zone (an offset that differs from the local zone's), that renders as "-0700 -0700", which the driver cannot parse back, so GetRecord failed on every sync for that order. Open the DB with _time_format=sqlite so times are written in SQLite's ISO form, and add migration 00011 to rewrite existing broken values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
eshaffer321
force-pushed
the
fix/sqlite-unnamed-zone-timestamps
branch
from
November 17, 2026 14:26
50b7ce9 to
34d5375
Compare
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every sync reported Walmart order
02796073446817290005as an error, even though it had already been processed successfully:Cause
By default
modernc.org/sqlitewrites atime.Timeusingtime.Time.String(). This order's timestamp had offset -07:00 while the local zone was MDT (-06:00), so Go gave it an unnamed fixed zone, andString()rendered it as2026-10-31 19:11:53 -0700 -0700. The driver can't parse that back into a time, so it returned a string and the scan intotime.Timefailed. The driver still behaves this way in v1.61.1.Fix
NewStorageopens the DB with_time_format=sqlite, so times are written as2006-01-02 15:04:05.999999999-07:00. The driver always parses this format, and SQLite's date functions understand it.00011_repair_unnamed_zone_timestamps.sqlrewrites existing... -0700 -0700values in every timestamp column to that form. The instant stays the same.Side effect: the item search's
date(order_date)used to return an empty date for every row, because SQLite couldn't read the old format. It now returns a UTC date for new and repaired rows.Tests
TestStorage_SaveRecord_UnnamedFixedZoneRoundTripsandTestMigrations_RepairUnnamedZoneTimestampsfailed with the production error before the fix and pass after it.go test ./... -racepasses, and golangci-lint v2.14.0 reports 0 issues.Logged in
docs/bug-fixes.md.🤖 Generated with Claude Code