fix: Parse RFC 3339 timestamps for feed pubDate #6

Merged
w33ble merged 1 commit from fix/feed-pubdate into main 2026-09-06 20:15:12 -06:00
Collaborator

Summary

  • feed.PubDate now tries both timestamp shapes: raw SQLite CURRENT_TIMESTAMP text (2006-01-02 15:04:05) and RFC 3339 (RFC3339Nano), normalizing to RFC-1123Z
  • Added TestPubDate covering both layouts, fractional seconds, and numeric offsets

Why

Every feed item rendered with the same pubDate = render time. The sqlite driver (modernc.org/sqlite) returns DATETIME columns as time.Time, and database/sql renders that as RFC 3339 when scanned into a string — which the old single-layout parse rejected, so every item fell back to time.Now().

  • Root-cause probe: querying episodes.created_at through the driver yields driver.Value of type time.Time
## Summary - `feed.PubDate` now tries both timestamp shapes: raw SQLite `CURRENT_TIMESTAMP` text (`2006-01-02 15:04:05`) and RFC 3339 (`RFC3339Nano`), normalizing to RFC-1123Z - Added `TestPubDate` covering both layouts, fractional seconds, and numeric offsets ## Why Every feed item rendered with the same pubDate = render time. The sqlite driver (modernc.org/sqlite) returns `DATETIME` columns as `time.Time`, and `database/sql` renders that as RFC 3339 when scanned into a string — which the old single-layout parse rejected, so every item fell back to `time.Now()`. ## Related - Root-cause probe: querying `episodes.created_at` through the driver yields `driver.Value` of type `time.Time`
fix: parse RFC 3339 timestamps for feed pubDate
All checks were successful
ci / check (pull_request) Successful in 4m13s
a2bcf4fcdd
The sqlite driver returns DATETIME columns as time.Time and database/sql
renders it RFC3339Nano when scanned into a string, which feed.PubDate
could not parse — every item fell back to now. Try both layouts.
w33ble approved these changes 2026-09-06 20:15:05 -06:00
w33ble merged commit 132d5deeeb into main 2026-09-06 20:15:12 -06:00
w33ble deleted branch fix/feed-pubdate 2026-09-06 20:15:12 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
w33ble/mediacast!6
No description provided.