fix(timezone): consolidate table wall-clock conversion - #7072
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
65d49f5 to
3a68f2d
Compare
Greptile SummaryThe PR consolidates table wall-clock conversion and timezone formatting into the shared timezone utility, while tightening date validation and expanding timezone-focused tests.
Confidence Score: 4/5The PR should not merge until ambiguous fall-back table inputs preserve the established later-occurrence behavior or the compatibility change is explicitly handled. The new shared resolver is reached by current date and TTL editor paths and changes a previously accepted ambiguous wall clock to an instant one hour earlier, which can alter persisted dates and expiration epochs. Files Needing Attention: apps/sim/lib/core/utils/timezone.ts, apps/sim/lib/table/dates.ts
|
| Filename | Overview |
|---|---|
| apps/sim/lib/core/utils/timezone.ts | Introduces the shared formatting and wall-clock resolver, but changes ambiguous fall-back inputs from the later occurrence to the earlier one. |
| apps/sim/lib/table/dates.ts | Centralizes timezone-aware normalization and adds strict calendar/time validation; it exposes table inputs to the resolver’s ambiguity-policy change. |
| apps/sim/lib/table/column-types/ttl.ts | Redirects TTL formatting through the shared timezone utility while retaining normalization through the table date path. |
| apps/sim/lib/core/utils/timezone.test.ts | Adds broad offset and DST coverage, including assertions that codify the changed fall-back ambiguity policy. |
| apps/sim/lib/table/dates.test.ts | Adds targeted coverage for localized inputs, invalid dates and times, DST transitions, and non-hour offsets. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Input[Naive table date or TTL input] --> Normalize[normalizeDateCellValue]
Normalize --> Stamp[zonedWallClockWithOffset]
Stamp --> Resolve[resolveZonedWallClock]
Resolve --> Candidate{Ambiguous DST overlap?}
Candidate -->|No| Instant[Resolved instant]
Candidate -->|Yes| Earlier[Select earliest exact candidate]
Earlier --> Persist[Persist date or TTL epoch]
Reviews (1): Last reviewed commit: 65d49f5 | Re-trigger Greptile
3a68f2d to
01e840a
Compare
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
01e840a to
fb99c64
Compare
fb99c64 to
01f58f2
Compare
01f58f2 to
acecea1
Compare
Summary
TTL and date cells now resolve wall-clock input through one core timezone implementation. This fixes browser/workspace-zone drift, invalid calendar rollover, and direction-dependent DST gap/fold handling while keeping epoch seconds stable when the display timezone changes.
This is the second PR in the stack and builds on PR #7071. It contains the shared conversion consolidation and its regression coverage.
Type of Change
Testing
UTC,America/Los_Angeles,America/New_York, andAsia/Tokyoprocess timezones.bun run check:api-validation,bun run check, andbunx turbo run lint:check --filter=simpass.@c15t/scriptsmodules; it reports no errors in this PR's files.Checklist
Screenshots/Videos
Not applicable. This PR changes shared conversion logic and tests, not UI layout.
Post-Deploy Monitoring & Validation
Table row TTL cleanup completedand correlate any unexpected deletion reports with the stored TTL epoch and workspace timezone.