Skip to content

fix: use sqlx chrono decode for thread timestamps instead of manual parsing#8575

Merged
matt2e merged 1 commit into
mainfrom
mtoohey/fix-thread-timestamp-parsing
Apr 16, 2026
Merged

fix: use sqlx chrono decode for thread timestamps instead of manual parsing#8575
matt2e merged 1 commit into
mainfrom
mtoohey/fix-thread-timestamp-parsing

Conversation

@matt2e
Copy link
Copy Markdown
Collaborator

@matt2e matt2e commented Apr 16, 2026

Summary

Use sqlx's native DateTime<Utc> decoding for thread timestamp columns (created_at, updated_at, archived_at) in ThreadRow instead of fetching as String and manually parsing with .parse().

Problem

The current code fetches timestamps as raw strings and parses them manually:

created_at: created_at.parse().unwrap_or_else(|_| Utc::now()),
updated_at: updated_at.parse().unwrap_or_else(|_| Utc::now()),

This has two issues:

  1. On parse failure, it silently falls back to Utc::now(), producing incorrect timestamps
  2. It duplicates work that sqlx already handles natively via the chrono feature

Fix

Change ThreadRow to decode timestamps as DateTime<Utc> directly, and simplify thread_from_row to pass them through without parsing.

Context

This fix was originally merged into the baxen/goose2 branch (PR #8502) but was missed when goose2 was moved into main via PR #8516 — the move PR was prepared from a snapshot that predated #8502.

@matt2e matt2e force-pushed the mtoohey/fix-thread-timestamp-parsing branch from aa0b898 to c61ad0a Compare April 16, 2026 01:06
…arsing

Use sqlx's native DateTime<Utc> decoding for thread timestamp columns
instead of fetching as String and manually parsing. This was missed when
the baxen/goose2 branch was merged into main via PR #8516.

The manual parsing silently falls back to Utc::now() on parse failure,
which could produce incorrect timestamps. Letting sqlx decode directly
is both more correct and simpler.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e force-pushed the mtoohey/fix-thread-timestamp-parsing branch from c61ad0a to 9a2d46f Compare April 16, 2026 01:11
@matt2e matt2e added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit c29e320 Apr 16, 2026
21 checks passed
@matt2e matt2e deleted the mtoohey/fix-thread-timestamp-parsing branch April 16, 2026 03:14
jh-block added a commit to sunilkumarvalmiki/goose that referenced this pull request Apr 16, 2026
…l-placeholder

* origin/main: (64 commits)
  fix: expand tool calls by default when Response Style is Detailed (aaif-goose#8478)
  fix: create logs dir before writing llm request log (aaif-goose#8522)
  fix: enable token usage tracking and configurable stream timeout for Ollama provider (aaif-goose#8493)
  fix tauri-plugin-dialog version constraint to match other plugins (aaif-goose#8542)
  call goose serve from tauri frontend via goose-acp client (aaif-goose#8549)
  failed the script when bundle:default fails and cleanup "alpha"  (aaif-goose#8580)
  pass globally unique conversation identifier as sessionId in databricks api call (aaif-goose#8576)
  fix: use sqlx chrono decode for thread timestamps instead of manual parsing (aaif-goose#8575)
  docs: remove stale gemini-acp references (aaif-goose#8572)
  show individual untracked files in git changes widget (aaif-goose#8574)
  fix: update publishing flow to include new sdk dir (aaif-goose#8573)
  fix: remove double border on content in chat (aaif-goose#8545)
  chore(goose2): `just goose2 <command>` with the addition of `just goose2 kill` (aaif-goose#8570)
  Lifei/oltp data (aaif-goose#8458)
  Sidebar polish: search copy, dividers, project reorder, fix DnD (aaif-goose#8568)
  remove the workflow_dispatch check (aaif-goose#8563)
  fix: one more rename (aaif-goose#8562)
  fix(desktop): accept self-signed certs from configured external goosed host (aaif-goose#8400)
  alexhancock/npm-bumps (aaif-goose#8557)
  Remove npm publish from release for now (aaif-goose#8558)
  ...
michaelneale added a commit that referenced this pull request Apr 17, 2026
* main: (37 commits)
  polish: refine sidebar activity indicators, add placeholder token, and tidy search field (#8606)
  feat: add /edit command to cli for on-demand prompt editing (#8566)
  docs(mcp): add Rendex MCP Server extension tutorial (#8541)
  Lifei/delete tauri backend acp (#8582)
  chore: set goose binaries as executable in package.json (#8589)
  feat: add Novita AI as declarative provider (#8432)
  feat: add Kimi Code provider with OAuth device flow authentication (#8466)
  fix: chat loading-state model placeholder (#8431)
  fix: expand tool calls by default when Response Style is Detailed (#8478)
  fix: create logs dir before writing llm request log (#8522)
  fix: enable token usage tracking and configurable stream timeout for Ollama provider (#8493)
  fix tauri-plugin-dialog version constraint to match other plugins (#8542)
  call goose serve from tauri frontend via goose-acp client (#8549)
  failed the script when bundle:default fails and cleanup "alpha"  (#8580)
  pass globally unique conversation identifier as sessionId in databricks api call (#8576)
  fix: use sqlx chrono decode for thread timestamps instead of manual parsing (#8575)
  docs: remove stale gemini-acp references (#8572)
  show individual untracked files in git changes widget (#8574)
  fix: update publishing flow to include new sdk dir (#8573)
  fix: remove double border on content in chat (#8545)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants