Skip to content

fix: show release date as Updated on cards - #384

Merged
neuromechanist merged 8 commits into
stagingfrom
fix/updated-badge-release-date
Sep 30, 2026
Merged

neuromechanist merged 8 commits into
stagingfrom
fix/updated-badge-release-date

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What

The "Updated" fact on a dataset card now shows the date of the latest release (the newest version row), not the catalog row's updated_at.

  • Dataset.latest_version_at (optional, nullable, SQLite UTC like first_published_at) is added to the type and to the search-hit fallback row.
  • formatReleaseDate in src/lib/release-date.ts is the one place that picks the date. It parses the zoneless SQLite value as UTC, formats it in UTC, and returns an empty string when the row has none.
  • DatasetCard.astro uses it. There is deliberately no fallback to updated_at.
  • A CHANGELOG entry under Unreleased.

Why

updated_at is bumped by any write to the row: an enrichment reindex, a DOI sync, a finalize. The catalog-wide enrichment sweep of 2026-09-29 therefore made cards read "Sep 29, 2026" for datasets released weeks earlier (for example nm000279: released 2026-09-16, updated_at 2026-09-29 23:29). A release date moves only when a version ships.

Dependency and promotion order

Needs the companion nemar-cli change that serves latest_version_at (the created_at of the newest dataset_versions row) on the catalog list and on GET /datasets/:id. Until it ships, the field is absent and cards simply omit "Updated"; nothing breaks. Verified against the live API with the dev server: /discover renders 11 cards, Version facts appear, no Updated fact.

  • Do not promote staging to main until the nemar-cli change is deployed to production, or every production card loses its "Updated" fact.
  • Staging deploys against the nemar-cli dev backends, so QA on test.nemar.org also needs the companion on dev first.
  • GET /datasets/:id matters because search results are hydrated from the detail endpoint (backfillSearchHit); if the companion change only covers the list, search cards keep omitting "Updated".

Deliberate non-changes

  • MyDatasetCard.astro ("Last updated"): the owner workspace, where drafts have no version yet and "when did my row last change" is the useful answer.
  • sitemap.xml <lastmod> (sitemapLastmod): still reads updated_at, so the sweep moved every dataset's lastmod to its date. That is a separate decision from the card badge and is not made here.
  • The detail page shows provenance.publish_date and the version switcher shows each version's own created_at; neither reads updated_at.

Tested

  • bun run lint, bun run typecheck (0 errors), bun run test (2645 passed, 111 files)
  • release-date.test.ts: present value, row touched after release, null, field absent, undefined/empty/malformed, RFC3339 input, search-hit fallback row
  • UTC boundary cases pin process.env.TZ per case (America/Los_Angeles, Pacific/Auckland), so they fail under the UTC-only CI runner if the helper parses or formats in local time (checked by removing timeZone: "UTC" from the helper: 2 failures under TZ=UTC)
  • api.test.ts: backfillSearchHit keeps the detail row's latest_version_at
  • test/dataset-card-updated.test.ts: the card calls formatReleaseDate(dataset) and never reads updated_at (source-level, like the other Astro wiring guards)
  • Positive render on a live card: waits on the nemar-cli change (the repo has no component test harness; pages are checked against a running server)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

@neuromechanist neuromechanist changed the title fix: show release date as Updated on dataset cards fix: show release date as Updated on cards Sep 30, 2026
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review findings and handling (Sonnet-model review of 0a82055)

No blocking issues in the production code.

  • Timezone tests could not fail in CI (UTC runner). They now pin process.env.TZ per case (America/Los_Angeles, Pacific/Auckland). Removing timeZone: "UTC" from the helper now fails 2 tests under a UTC process.
  • Search-card path unguarded. Added a backfillSearchHit test that the detail row's latest_version_at survives the merge.
  • Wiring untested. Added a source-level guard that DatasetCard.astro calls formatReleaseDate(dataset) and never reads updated_at.
  • Promotion order. The PR body now says not to promote staging to main until feat: serve latest_version_at in the catalog nemar-cli#1571 is deployed to production.
  • CHANGELOG: section order matches the file's convention, the transient wording is removed, and the entry references fix: show release date as Updated on cards #384. PR title shortened to under 50 characters.
  • Skipped, pre-existing: parseCatalogTimestamp accepts junk that V8's legacy parser tolerates and would throw on a non-string; SQLite TEXT cannot produce one, and it is outside this diff.
  • Skipped, intentional: the helper lives in release-date.ts because highlights.ts already imports format.ts, so format.ts would create a cycle.
  • Skipped, unrelated: a stale comment in api.ts about the detail endpoint returning null participants.

@neuromechanist
neuromechanist merged commit 7ed1817 into staging Sep 30, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the fix/updated-badge-release-date branch September 30, 2026 09:32
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