Add warning about safe-terminating when the query method returns null

Oliver 2025-12-06 16:05:25 -07:00
parent 7a3c3f065f
commit 38f2db30dd

@ -21,13 +21,15 @@ query data prior to being returned.
### `QueryManager.query` ### `QueryManager.query`
> QueryManager.query(request: [AskConfig](Dialog-Manager.md#askconfig), options: [QueryOptions](#queryoptions)): Promise<[QueryResponse](#queryresponse)|null> > QueryManager.query(request: [AskConfig](Dialog-Manager.md#askconfig), options: [QueryOptions](#queryoptions)): Promise<[QueryResponse](#queryresponse)|null>
This is the powerhouse of the Query Manager API, this is how you actually This is the powerhouse of the Query Manager API, this is how you actually prompt other users for information and do stuff with that information.
prompt other users for information and do stuff with that information.
The `request` parameter utilizes the same type as the [Dialog Manager's AskConfig](Dialog-Manager.md#askconfig), please consult that documentation for further information. The `request` parameter utilizes the same type as the [Dialog Manager's AskConfig](Dialog-Manager.md#askconfig), please consult that documentation for further information.
If you want to perform some operation on the data returned on a per-user basis as it arrives, you should provide the `options` an `onSubmit` event listener which will be called with each user's submitted data. If you want to perform some operation on the data returned on a per-user basis as it arrives, you should provide the `options` an `onSubmit` event listener which will be called with each user's submitted data.
> [!WARNING]
> You should safely stop execution when the returned Promise resolves to `null`, as that means the request was cancelled or there was one already waiting with the provided ID.
> [!NOTE] > [!NOTE]
> You can disable the status application by providing `showStatusApp: false` as an option. However, by doing so, will change when the Promise returned from this method is resolved. > You can disable the status application by providing `showStatusApp: false` as an option. However, by doing so, will change when the Promise returned from this method is resolved.