Skip to content

fix: preserve datetime timezone on row updates - #3167

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix-2870-datetime-timezone-drift
Aug 18, 2026
Merged

fix: preserve datetime timezone on row updates#3167
ChiragAgg5k merged 1 commit into
mainfrom
fix-2870-datetime-timezone-drift

Conversation

@cursor

@cursor cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Fixes #2870: updating a row from the Console re-submits datetime columns as timezone-less local ISO strings, so the API stores them as UTC and values drift by the browser offset on every save.
  • Canonicalize datetime scalars and arrays to UTC in buildPayload, matching the existing filters path (new Date(value).toISOString()).
  • Adds unit coverage for round-trip / array / null / bigint behavior.

Test plan

  • bun run test:unit -- .../rows/store.test.ts (5 passed)
  • Manually: create a row with a datetime in a non-UTC timezone, update a different field without touching the datetime, confirm the datetime instant is unchanged
Open in WebView Automation

Datetime inputs are displayed as timezone-less local ISO strings. Without
converting back to UTC on submit, unchanged datetime fields drift by the
browser offset on every update (console#2870). Mirror the filters path and
canonicalize datetime scalars/arrays in buildPayload.

Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
@cursor
cursor Bot requested a review from ChiragAgg5k August 18, 2026 03:36
@appwrite

appwrite Bot commented Aug 18, 2026

Copy link
Copy Markdown

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Our Discord community has grown to 24K developers, and counting

@cursor
cursor Bot marked this pull request as ready for review August 18, 2026 03:36
@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR prevents datetime values from drifting during row updates by converting local datetime input strings back to UTC ISO strings before submission.

  • Adds datetime normalization for scalar and array fields in buildPayload.
  • Preserves null, empty, invalid, and non-string values.
  • Adds focused tests for timezone round trips, arrays, nullable values, and existing bigint conversion.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete regressions identified in the reachable row creation or update paths.

Current datetime editors provide local datetime strings that the new conversion correctly restores to UTC, while timezone-bearing generated values remain unchanged and existing null, invalid, and bigint behavior is preserved.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/store.ts Adds datetime-aware payload casting that correctly reverses the local display encoding while preserving existing bigint behavior.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/store.test.ts Adds focused coverage for datetime round trips, arrays, nullable values, and bigint regression behavior.

Reviews (1): Last reviewed commit: "fix: preserve datetime timezone on row u..." | Re-trigger Greptile

@ChiragAgg5k
ChiragAgg5k merged commit a723540 into main Aug 18, 2026
4 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix-2870-datetime-timezone-drift branch August 18, 2026 07:02
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.

Console updates datetime fields even when unchanged, causing timezone drift (+9h on every update)

2 participants