Skip to content

fix: event details dialog crashed on a string timestamp - #337

Merged
HardMax71 merged 1 commit into
mainfrom
fix/event-detail-dates
Oct 11, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
fix/event-detail-dates

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Clicking an event in the admin event browser did nothing on main since #335. The page threw e.getTime is not a function and the details dialog never opened.

hey-api's transformer plugin skips any field whose schema is a union. EventDetailResponse.event is the DomainEvent union, so its timestamp stays a string while the generated type says Date, and formatTimestamp crashed on it. The events store now converts that one field in a select when it loads the detail. Nothing about the generated client changes.

Arrays of the union, the browse list and the user overview's recent events, get the first variant's transformer for every item. That converts timestamp, which every variant has, so those pages are fine. Fields that only some variants carry, such as sent_at or cancelled_at, stay strings there too, but nothing formats them; they only show up in the raw JSON view.

A store unit test feeds a string timestamp and expects a Date. A new Playwright test opens the first event in the browser and checks the Timestamp row. It fails against a build without the fix and passes with it, along with the rest of the admin events spec. Vitest passes 1062 tests and the gates are clean.


Summary by cubic

Fixes the admin event details dialog crashing when opening an event. Since #335 the generated SDK returns timestamp as a string on the event detail's event field — the transformer skips union-typed fields — so formatTimestamp called getTime on a string and the dialog never opened.

The events store now converts that field to a Date when loading the detail. Browse lists already work because arrays apply the first variant's transformer, which converts timestamp for every variant.

  • Converts event.timestamp to a Date in the event detail query via a select callback.
  • Adds a unit test with a string timestamp and a Playwright test that opens an event and checks the Timestamp row.

Written for commit b5f6eb5. Summary will update on new commits.

View guided diff Turn on auto-fix

Since #335 the generated SDK turns date-time fields into Dates, but hey-api's transformer skips a field whose schema is a union, and the event detail's `event` is the DomainEvent union. Its timestamp stayed a string, the formatter called getTime on it, and the dialog never opened. The events store now converts that one field when it loads the detail. A unit test and a Playwright test that opens a real event cover it; the Playwright one fails without the fix.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c20035e4-e94b-44e1-ba54-d6abdd9893af

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the area: frontend Svelte UI and the generated API client label Oct 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov-commenter

codecov-commenter commented Oct 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-e2e 82.87% <ø> (-0.09%) ⬇️
backend-unit 72.33% <ø> (ø)
frontend-unit 88.31% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rontend/src/lib/admin/stores/eventsStore.svelte.ts 90.24% <100.00%> (+0.12%) ⬆️

... and 3 files with indirect coverage changes

Components Coverage Δ
Backend 91.36% <ø> (-0.09%) ⬇️
Frontend 88.31% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit cdc5d62 into main Oct 11, 2026
19 of 20 checks passed
@HardMax71
HardMax71 deleted the fix/event-detail-dates branch October 11, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Svelte UI and the generated API client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants