Skip to content

fix: hydration error from date formatting timezone mismatch#1863

Merged
amikofalvy merged 1 commit intomainfrom
fix/date-formatting-hydration-error
Feb 10, 2026
Merged

fix: hydration error from date formatting timezone mismatch#1863
amikofalvy merged 1 commit intomainfrom
fix/date-formatting-hydration-error

Conversation

@amikofalvy
Copy link
Collaborator

Summary

Fixes PILOT-INKEEP-COM-J - Hydration error affecting 59 occurrences across 60+ URLs, impacting 15 users since Jan 15.

Problem

All date formatting functions in format-date.ts used Intl.DateTimeFormat without specifying timeZone, causing server/client mismatches:

  • Server (Vercel): defaults to UTC
  • Client (browser): defaults to user's local timezone

For dates near midnight UTC, this produces different formatted strings (e.g., "Jan 20, 2025" vs "Jan 19, 2025"), triggering React hydration errors.

Changes

Added timeZone: 'UTC' to all date formatting functions:

  • formatDate
  • formatDateTime
  • formatDateTimeTable
  • formatDateAgo

Test plan

  • All 22 existing format-date tests pass
  • No linter errors introduced
  • Monitor Sentry after deployment for resolution

Made with Cursor

Fixes PILOT-INKEEP-COM-J

Added timeZone: 'UTC' to all Intl.DateTimeFormat calls in format-date.ts
to ensure server and client render identical date strings.

The issue occurred because formatDate, formatDateTime, formatDateTimeTable,
and formatDateAgo used Intl.DateTimeFormat without specifying a timezone.
Server (Vercel) defaulted to UTC while clients used their local timezone,
causing hydration mismatches for dates near midnight.

This affected 59 occurrences across 60+ URLs impacting 15 users.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: ad042be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@inkeep/agents-manage-ui Patch
@inkeep/agents-api Patch
@inkeep/agents-cli Patch
@inkeep/agents-core Patch
@inkeep/agents-manage-mcp Patch
@inkeep/agents-mcp Patch
@inkeep/agents-sdk Patch
@inkeep/agents-work-apps Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 10, 2026 0:34am
agents-docs Ready Ready Preview, Comment Feb 10, 2026 0:34am
agents-manage-ui Ready Ready Preview, Comment Feb 10, 2026 0:34am

Request Review

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

0 Key Findings | Risk: Low

🔴❗ Critical (0) ❗🔴

None.

🟠⚠️ Major (0) 🟠⚠️

None.

🟡 Minor (0) 🟡

None.

💭 Consider (1) 💭

💭 1) invocations-table.tsx:34-46 Pre-existing similar pattern without UTC timezone

Issue: There's a local formatDate function in invocations-table.tsx that uses toLocaleString() without timeZone: 'UTC', which could have the same hydration issue this PR fixes.

Why: While out of scope for this PR (pre-existing, not worsened by these changes), it may warrant a follow-up fix for consistency.

Fix: Consider a follow-up PR to either use the shared formatDateTime from format-date.ts or add timeZone: 'UTC' to that local function.

Refs: invocations-table.tsx:34-46

🕐 Pending Recommendations (0)

None — this is the first review.


✅ APPROVE

Summary: This is a clean, well-targeted bug fix! 🎉 The fix correctly addresses the React hydration error (Sentry: PILOT-INKEEP-COM-J) by adding timeZone: 'UTC' to all four date formatting functions. The implementation is minimal, consistent, and follows the recommended pattern for resolving date-based hydration mismatches in Next.js applications. All existing tests pass, and the changeset is properly formatted.

Note: I cannot submit a formal GitHub approval due to permission restrictions, but this PR is recommended for approval.

Discarded (0)

No findings were discarded.

Reviewers (3)
Reviewer Returned Main Findings Consider Inline Comments Pending Recs Discarded
pr-review-standards 0 0 0 0 0 0
pr-review-frontend 0 0 0 0 0 0
pr-review-sre 0 0 0 0 0 0
Total 0 0 0 0 0 0

Note: The Consider item was identified through orchestrator analysis of reviewer observations, not as a formal finding.

@github-actions github-actions bot deleted a comment from claude bot Feb 10, 2026
@amikofalvy amikofalvy merged commit 6fb0715 into main Feb 10, 2026
8 of 10 checks passed
@amikofalvy amikofalvy deleted the fix/date-formatting-hydration-error branch February 10, 2026 00:39
@inkeep
Copy link
Contributor

inkeep bot commented Feb 10, 2026

No docs changes detected. This is an internal bug fix for timezone handling in date formatting utilities.

@inkeep
Copy link
Contributor

inkeep bot commented Feb 10, 2026

No docs changes detected. This is an internal bug fix for date formatting utilities in the management UI that doesn't introduce new user-facing features or API changes.

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.

1 participant