-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(Issues): AI Search #105768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Issues): AI Search #105768
Conversation
| const endLocal = resultEnd.endsWith('Z') ? resultEnd.slice(0, -1) : resultEnd; | ||
| timeParams = { | ||
| start: new Date(startLocal).toISOString(), | ||
| end: new Date(endLocal).toISOString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing validation for invalid date strings causes crash
Medium Severity
The applySeerSearchQuery callback calls new Date(startLocal).toISOString() without validating that the date strings from the AI-powered API response are valid dates. If the API returns a malformed date string (possible with AI responses), new Date("invalid-string") creates an Invalid Date object, and calling .toISOString() on it throws an uncaught RangeError: Invalid time value. This would crash the component when a user selects a query result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting point, we do validate this on the backend, but curious if we should also validate here.
nsdeschenes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments, small things non-blocking
| let initialSeerQuery = ''; | ||
| const queryDetails = useMemo(() => { | ||
| const queryToUse = committedQuery.length > 0 ? committedQuery : query; | ||
| const parsedQuery = parseQueryBuilderValue(queryToUse, getFieldDefinition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment about this from the errors PR also applicable here 👀
| navigate({ | ||
| pathname: location.pathname, | ||
| query: queryParams, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the same options passed here, like prevent scroll etc.?
4817ea5 to
f589d73
Compare
gen-ai-search-agent-translatefor internal use first