@deephaven-enterprise/query-utils 2026.1.34 → 2026.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import type { EditableQueryInfo, PlainEditableQueryInfo, TypeSpecificFields } from '@deephaven-enterprise/jsapi-types';
1
+ import type { PlainEditableQueryInfo, TypeSpecificFields } from '@deephaven-enterprise/jsapi-types';
2
2
  import QueryScheduler from './QueryScheduler';
3
3
  export type ScriptDraftQuery = IDraftQuery & {
4
4
  scriptLanguage: string;
@@ -146,7 +146,7 @@ export declare class DraftQuery implements IDraftQuery {
146
146
  *
147
147
  * @param editableQuery the Editable Query from the Server
148
148
  */
149
- saveDraftToQuery<T extends EditableQueryInfo>(editableQuery: Partial<T> & Pick<T, 'serial'>): T;
149
+ saveDraftToQuery<T extends PlainEditableQueryInfo>(editableQuery: Partial<T> & Pick<T, 'serial'>): T;
150
150
  /**
151
151
  * Updates the JVM args to include the thread count for initialization and update threads.
152
152
  * It is safe to call from saveDraftToQuery because the the thead counts will be set to
@@ -49,7 +49,15 @@ export declare class QueryScheduler {
49
49
  * Creates a Default Scheduler.
50
50
  */
51
51
  static createDefault: () => QueryScheduler;
52
- static makeDefaultScheduling(restartQueryWhenRunningDefault: string, timeZone: string): [string, string];
52
+ /**
53
+ * Build a default scheduling string array for a new query.
54
+ *
55
+ * Starts from the server-provided defaults (from `queryScheduler.default<N>`
56
+ * in `iris-defaults.prop`) and overrides `RestartWhenRunning` and `TimeZone`
57
+ * with the supplied values so the user's UI time zone preference and the
58
+ * configured `queryScheduler.restartWhenRunningDefault` win.
59
+ */
60
+ static makeDefaultScheduling(restartQueryWhenRunningDefault: string, timeZone: string, serverDefaults?: readonly string[]): string[];
53
61
  /**
54
62
  * Generate a scheduler array for a persistent query that has temporary scheduling.
55
63
  * @param autoDelete if True, automatically delete the PQ after it's completed
@@ -13,15 +13,30 @@ const DEFAULT_TIME_ZONE = 'America/New_York';
13
13
  * storage on the server.
14
14
  */
15
15
  export class QueryScheduler {
16
- static makeDefaultScheduling(restartQueryWhenRunningDefault, timeZone) {
17
- return [
18
- QueryScheduler.TOKENS.RESTART_WHEN_RUNNING +
19
- QueryScheduler.TOKENS.DELIMITER +
20
- restartQueryWhenRunningDefault,
21
- QueryScheduler.TOKENS.TIME_ZONE +
22
- QueryScheduler.TOKENS.DELIMITER +
23
- timeZone,
24
- ];
16
+ /**
17
+ * Build a default scheduling string array for a new query.
18
+ *
19
+ * Starts from the server-provided defaults (from `queryScheduler.default<N>`
20
+ * in `iris-defaults.prop`) and overrides `RestartWhenRunning` and `TimeZone`
21
+ * with the supplied values so the user's UI time zone preference and the
22
+ * configured `queryScheduler.restartWhenRunningDefault` win.
23
+ */
24
+ static makeDefaultScheduling(restartQueryWhenRunningDefault, timeZone, serverDefaults = []) {
25
+ const overrideTokens = new Set([
26
+ QueryScheduler.TOKENS.RESTART_WHEN_RUNNING,
27
+ QueryScheduler.TOKENS.TIME_ZONE,
28
+ ]);
29
+ const result = serverDefaults.filter(s => {
30
+ const token = s.split(QueryScheduler.TOKENS.DELIMITER, 1)[0];
31
+ return !overrideTokens.has(token);
32
+ });
33
+ result.push(QueryScheduler.TOKENS.RESTART_WHEN_RUNNING +
34
+ QueryScheduler.TOKENS.DELIMITER +
35
+ restartQueryWhenRunningDefault);
36
+ result.push(QueryScheduler.TOKENS.TIME_ZONE +
37
+ QueryScheduler.TOKENS.DELIMITER +
38
+ timeZone);
39
+ return result;
25
40
  }
26
41
  /**
27
42
  * Generate a scheduler array for a persistent query that has temporary scheduling.
@@ -492,15 +492,17 @@ export function sendWidgetMessage({ client, corePlusManager, dh, message, onEven
492
492
  const api = await corePlusManager.getApi(query.workerKind, jsApiUrl);
493
493
  const coreConnection = await corePlusManager.getConnection(api, grpcUrl, envoyPrefix);
494
494
  const widget = (await coreConnection.getObject(objectDefinition));
495
+ const startTime = performance.now();
495
496
  // Set a timeout for the message to be received
496
497
  // TODO: DH-20345: This timeout doesn't properly cleanup or surface an error
497
498
  // to the caller.
498
499
  const timeoutId = setTimeout(() => {
499
500
  // This logs a warning rather than throwing an error because the message may still be received later and to avoid breaking the UI
500
- log.warn(`No response from the server after ${MESSAGE_TIMEOUT}ms for message: ${message}`);
501
+ log.warn(`[${objectDefinition.name}:${query.name}] widget message response is taking longer than the expected ${MESSAGE_TIMEOUT}ms. message:`, [message]);
501
502
  }, MESSAGE_TIMEOUT);
502
503
  // Messages may come out of order, so the calling code is responsible for determining if the message is correct and clean up
503
504
  const removeListener = widget.addEventListener(api.Widget.EVENT_MESSAGE, event => onEventCallback(event, () => {
505
+ log.debug(`[${objectDefinition.name}:${query.name}] widget message response received in ${performance.now() - startTime}ms. message:`, [message]);
504
506
  clearTimeout(timeoutId);
505
507
  removeListener();
506
508
  widget.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven-enterprise/query-utils",
3
- "version": "2026.1.34",
3
+ "version": "2026.1.36",
4
4
  "description": "Deephaven Enterprise Query Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "SEE LICENSE IN LICENSE.md",