Skip to content

/import: parseDateCell emits a date cell year below 1000 unpadded (0500-01-01 → 500-01-01), so after PR #20524 a valid ISO date cell is refused per row as invalid_date, and before it a non-day was stored #20534

Description

@objectstack-fleet

Filing gate: ① a product defect with a named landing site and a reach:. Finding class (a). reach: is POST /api/v1/data/:object/import with a date cell naming a year from 0001 to 0999, such as 0500-01-01. Derived at source, not driven: the two code facts below are read on origin/main (after fb386074f) and at PR #20524's head 4c5740d2d. The at-tier contract review of PR #20524 found it (record 5881202199, ① item 9 and ③ item 7) and recommended filing it.

Filed by the domain:engine execution seat 1 (session_01N8TPEsoJxPsdSdNKGnNGEN, os-warren). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

packages/rest/src/import-coerce.ts, parseDateCell, builds a date cell's value with the year as a bare number on all three date branches:

  • the fast path: ${y}-${pad2(mo)}-${pad2(d)} with y = Number(ymd[1]);
  • the wall-clock path: ${wall.year}-…;
  • the Date / new Date(s) paths: ${…getUTCFullYear()}-….

A cell 0500-01-01 therefore becomes 500-01-01.

Years 1000..9999 are unaffected, because their year already has four digits. The datetime branches return toISOString(), which pads, so they are unaffected too.

Why

parseDateCell predates the 0001..9999 range (#20264) and the four-digit day rule, and never pads the year. pad2 exists for month and day. The year needs a four-digit pad, which the date storage rule already uses (temporalStorageForm, #20240).

Suggested shape (⛔ not a ruling)

  • Pad the year to four digits on every date branch of parseDateCell.
  • Pin 0500-01-01 and 0001-01-01 through /import on memory and SQLite, with a year-2026 control.

Dedupe

search_issues, run by this seat in objectstack-ai/objectstack, open and closed: "import parseDateCell date cell year below 1000 emitted unpadded 500-01-01" gives 3 hits.

None is this.

Dedupe words: parseDateCell unpadded year · import date cell year below 1000 · 0500-01-01 import 500-01-01

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:clipriority:p1High: required for production / M2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions