-
Notifications
You must be signed in to change notification settings - Fork 231
fix(compass-query-bar): add a maxTimeMS over 5min warning to CompassWeb COMPASS-9023 #7380
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
base: main
Are you sure you want to change the base?
Conversation
); | ||
|
||
// Data Explorer limits for maxTimeMS (5 minutes = 300,000ms) | ||
const WEB_MAX_TIME_MS_LIMIT = 300_000; // 5 minutes |
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.
I'd suggest storing this in a single place + explaining why 5 minutes is the value we chose here
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.
agreed and done!
467c47f
to
07cfa90
Compare
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.
Pull Request Overview
This PR adds a maxTimeMS warning system for CompassWeb to prevent users from setting query timeouts longer than 5 minutes (300,000ms), which is the Data Explorer backend limit. The implementation uses a new preference showMaxTimeMSWarning
that is enabled by default in the web environment.
- Adds
showMaxTimeMSWarning
preference to control the warning behavior - Implements hard limit enforcement and validation for maxTimeMS fields
- Adds tooltip warnings when users attempt to exceed the 5-minute limit
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
packages/compass-web/src/entrypoint.tsx | Enables the showMaxTimeMSWarning preference by default for CompassWeb |
packages/compass-preferences-model/src/preferences-schema.tsx | Defines the new showMaxTimeMSWarning preference with proper schema validation |
packages/compass-query-bar/src/constants/query-option-definition.ts | Adds WEB_MAX_TIME_MS_LIMIT constant and updates maxTimeMS input validation |
packages/compass-query-bar/src/utils/query.ts | Updates validation functions to enforce the 5-minute limit when warnings are enabled |
packages/compass-query-bar/src/stores/query-bar-reducer.ts | Passes showMaxTimeMSWarning preference to validation functions |
packages/compass-query-bar/src/components/query-option.tsx | Adds tooltip warning UI for maxTimeMS fields exceeding the limit |
packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-options/pipeline-collation.tsx | Applies the same maxTimeMS validation and warning to aggregation pipeline options |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// Data Explorer limits for maxTimeMS (5 minutes = 300,000ms) | ||
const WEB_MAX_TIME_MS_LIMIT = 300_000; // 5 minutes |
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.
This constant is duplicated from packages/compass-query-bar/src/constants/query-option-definition.ts
. Consider importing WEB_MAX_TIME_MS_LIMIT
from the constants file instead of redefining it to avoid potential inconsistencies.
Copilot uses AI. Check for mistakes.
// Data Explorer limits (5 minutes = 300,000ms) | ||
const WEB_MAX_TIME_MS_LIMIT = 300_000; // 5 minutes |
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.
This constant is duplicated from packages/compass-query-bar/src/constants/query-option-definition.ts
. Consider importing WEB_MAX_TIME_MS_LIMIT
from the constants file instead of redefining it to avoid potential inconsistencies.
Copilot uses AI. Check for mistakes.
...compass-aggregations/src/components/pipeline-toolbar/pipeline-options/pipeline-collation.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Description
Using a preference I control whether or not to show the warning and prevent setting a higher maxTimeMS.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes