fix(tables): use explicit timestamps for expiration - #7689
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR establishes explicit-offset ISO timestamps as the Expiration storage contract and aligns editing, filtering, uniqueness, import/export, and cleanup behavior with that representation.
Confidence Score: 5/5The PR appears safe to merge, with no new actionable correctness or repository-rule violations identified. The earlier legacy-data concern was withdrawn after confirming Expiration has not shipped, and its thread is resolved. The earlier calendar finding is also resolved, and current date-selection and Today paths retain seconds and fractional precision as claimed. No blocking failure remains in the recent offset-preservation, comparison, uniqueness, import/export, or cleanup changes.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/table/ttl-values.ts | Defines the offset-preserving Expiration representation, instant projection, and picker conversion helpers. |
| apps/sim/lib/table/column-types/comparison-sql.ts | Adds guarded timestamp projection for instant-based equality and uniqueness checks. |
| apps/sim/lib/table/sql.ts | Routes Expiration equality and membership predicates through instant-based comparison. |
| apps/sim/lib/table/validation.ts | Aligns in-memory and database-backed uniqueness checks with the Expiration instant. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/inline-editors.tsx | Preserves stored offsets during inline calendar date changes and Today interactions. |
| packages/emcn/src/components/calendar/calendar.tsx | Retains literal seconds and fractional seconds when changing the date of an offset-free calendar value. |
| apps/sim/background/cleanup-table-row-ttl.ts | Implements bounded, failure-isolated cleanup with fresh discovery on later retries. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Input[API, import, or editor input] --> Normalize[Validate explicit ISO timestamp]
Normalize --> Store[(Store wall clock, fraction, and offset)]
Store --> Display[Editor and export preserve stored representation]
Store --> Compare[Project to timestamptz instant]
Compare --> Filters[Equality and range filters]
Compare --> Unique[Uniqueness checks]
Store --> Cleanup[Expiration cleanup]
Reviews (2): Last reviewed commit: "fix(tables): preserve expiration precisi..." | Re-trigger Greptile
|
@cubic-dev-ai review this PR |
@j15z I have started the AI code review. It will take a few minutes to complete. |
Summary
Expiration has not been released, so these changes define its initial timestamp contract. There are no production Expiration tables requiring a numeric-value migration.
Type of Change
Testing
2,162 regression tests and 23 real PostgreSQL scenarios pass. Verified live API writes, filters, uniqueness, CSV export, and cron. Type checking, lint, all 46 audits, and generated-catalog parity pass. The review follow-up also passes 22 calendar tests and 108 table/search UI tests: date changes preserve seconds and microseconds, including across a daylight-saving gap, and the search setup test waits for its queued URL update. Chrome recheck was blocked by repeated automation timeouts; editor tests pass. See docs/testing/expiration-qa.md for coverage and operational limits.
Checklist