Skip to content

Web console: defensive coding around dayjs#18723

Merged
vogievetsky merged 1 commit intoapache:masterfrom
vogievetsky:fix_segment_view_crashing_on_dayjs
Nov 6, 2025
Merged

Web console: defensive coding around dayjs#18723
vogievetsky merged 1 commit intoapache:masterfrom
vogievetsky:fix_segment_view_crashing_on_dayjs

Conversation

@vogievetsky
Copy link
Copy Markdown
Contributor

@vogievetsky vogievetsky commented Nov 6, 2025

This is a quick and dirty fix for a bug that is affecting me right now.

Segment view crashes if there are segments with 5 digit year start/end dates (far future data).

This bug was introduced in #18455. basically dayjs(value).toISOString() will throw if value is an unparsable date like (12025-11-06T20:43:44.172Z). So it needs to be wrapped in a try catch or some other check. In the task view this was coded more defensively:

image

But in the segments view this will throw.
I made a quick and dirty fix that I verified works.

I am not utilizing day.isValid() in my fix because I believe there might be a way to achieve the functionality desired in #18455 without importing dayjs at all which would save an import. Will look into it after I can access the segment view in my cluster.

Also I want to look into wrapping the table of every view in a React error boundary

@vogievetsky vogievetsky merged commit a0b5d68 into apache:master Nov 6, 2025
10 checks passed
@vogievetsky vogievetsky deleted the fix_segment_view_crashing_on_dayjs branch November 6, 2025 22:38
@kgyrtkirk kgyrtkirk added this to the 36.0.0 milestone Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants