Skip to content

Commit ce2e27a

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 2b6294a + b76ea7d commit ce2e27a

File tree

7 files changed

+66
-24
lines changed

7 files changed

+66
-24
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ This document was automatically generated on Mon Sep 25 2023.
234234
| **[debug](#233219ced46fb5b84e28859835e97775eb9d0181f4cb85d6aa5cecb61e595947)** | 2.6.9 | MIT |
235235
| **[debug](#d17e389ce22af9246d1b07714885a99a0c7ffce55db7f2ecf52bfef063e8c8ac)** | 4.3.1 | MIT |
236236
| **[decompress-response](#71cad5eab34cc643a6a7853a43d3090ac7e8b6014c9ec55fabb8112cdbfd9fbd)** | 5.0.0 | MIT |
237+
| **[dedent](#339f63cd441e23f69d2d748fb33f2abd1800e36538a684f9005b16194d1c219b)** | 1.5.1 | MIT |
237238
| **[deep-extend](#654bd7d00073c2195bca924a07d93393b2aaf5cacbb6f52a383877f6f33dbfbf)** | 0.6.0 | MIT |
238239
| **[default-browser-id](#bc6a381b83371172dbb72cac459792e2d4d55ecb71165c082142ef085b2130ee)** | 3.0.0 | MIT |
239240
| **[default-browser](#bf5c7331e49e4c648e57747ffd553870a7fe79fea24780366a6bc22ef346f304)** | 4.0.0 | MIT |
@@ -20039,6 +20040,38 @@ License files:
2003920040

2004020041
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2004120042

20043+
<a id="339f63cd441e23f69d2d748fb33f2abd1800e36538a684f9005b16194d1c219b"></a>
20044+
20045+
### [dedent](https://www.npmjs.com/package/dedent) (version 1.5.1)
20046+
20047+
License tags: MIT
20048+
20049+
License files:
20050+
20051+
- LICENSE:
20052+
20053+
The MIT License (MIT)
20054+
20055+
Copyright (c) 2015 Desmond Brand ([email protected])
20056+
20057+
Permission is hereby granted, free of charge, to any person obtaining a copy
20058+
of this software and associated documentation files (the "Software"), to deal
20059+
in the Software without restriction, including without limitation the rights
20060+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20061+
copies of the Software, and to permit persons to whom the Software is
20062+
furnished to do so, subject to the following conditions:
20063+
20064+
The above copyright notice and this permission notice shall be included in
20065+
all copies or substantial portions of the Software.
20066+
20067+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20068+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20069+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20070+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20071+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20072+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20073+
THE SOFTWARE.
20074+
2004220075
<a id="654bd7d00073c2195bca924a07d93393b2aaf5cacbb6f52a383877f6f33dbfbf"></a>
2004320076

2004420077
### [deep-extend](https://www.npmjs.com/package/deep-extend) (version 0.6.0)

packages/compass-components/src/components/generative-ai/generative-ai-input.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('GenerativeAIInput Component', function () {
101101
],
102102
[
103103
'QUERY_GENERATION_FAILED',
104-
'Something went wrong, please try again later. If the error persists, try changing your prompt.',
104+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.',
105105
],
106106
].forEach(([errorCode, expectedText]) => {
107107
it(`renders an error for ${errorCode}`, function () {
@@ -135,7 +135,7 @@ describe('GenerativeAIInput Component', function () {
135135

136136
const errorMsg = screen.getByTestId('ai-error-msg');
137137
expect(errorMsg).to.have.text(
138-
'Something went wrong, please try again later. If the error persists, contact our support team.'
138+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.'
139139
);
140140
expect(errorMsg).to.be.visible;
141141
});

packages/compass-components/src/components/generative-ai/generative-ai-input.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -416,20 +416,11 @@ const AIError = ({
416416
);
417417
}
418418

419-
if (errorCode === 'QUERY_GENERATION_FAILED') {
420-
return (
421-
<>
422-
Something went wrong, please try again later. If the error persists, try
423-
changing your prompt.
424-
</>
425-
);
426-
}
427-
428419
// We received an errorCode that is not actionable (INTERNAL_SERVER_ERROR, QUERY_GENERATION_FAILED), or unknown.
429420
return (
430421
<>
431-
Something went wrong, please try again later. If the error persists,
432-
contact our support team.
422+
Sorry, we were unable to generate the query, please try again. If the
423+
error persists, try changing your prompt.
433424
</>
434425
);
435426
};

packages/compass-e2e-tests/tests/collection-ai-query.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('Collection ai query', function () {
159159
);
160160
await errorBanner.waitForDisplayed();
161161
expect(await errorBanner.getText()).to.equal(
162-
'Something went wrong, please try again later. If the error persists, contact our support team.'
162+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.'
163163
);
164164
});
165165
});

packages/compass-e2e-tests/tests/collection-documents-tab.test.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Telemetry } from '../helpers/telemetry';
66
import { beforeTests, afterTests, afterTest } from '../helpers/compass';
77
import type { Compass } from '../helpers/compass';
88
import * as Selectors from '../helpers/selectors';
9-
import type { Element } from 'webdriverio';
9+
import type { Element, ElementArray } from 'webdriverio';
1010
import { createNumbersCollection } from '../helpers/insert-data';
1111

1212
const { expect } = chai;
@@ -16,19 +16,31 @@ interface RecentQuery {
1616
}
1717

1818
async function getRecentQueries(
19-
browser: CompassBrowser
19+
browser: CompassBrowser,
20+
expectQueries = false
2021
): Promise<RecentQuery[]> {
2122
const history = await browser.$(Selectors.QueryBarHistory);
2223
if (!(await history.isDisplayed())) {
2324
await browser.clickVisible(Selectors.QueryBarHistoryButton);
2425
await history.waitForDisplayed();
2526
}
2627

27-
const queryTags = await browser.$$(
28-
'[data-testid="query-history-query-attributes"]'
29-
);
28+
let queryTags;
29+
await browser.waitUntil(async () => {
30+
queryTags = await browser.$$(
31+
'[data-testid="query-history-query-attributes"]'
32+
);
33+
// Usually we expect to find some recents and the most common failure is
34+
// that we read out the queries before they are rendered.
35+
if (expectQueries) {
36+
// Keep going until we find something or timeout if we never do
37+
return queryTags.length > 0;
38+
}
39+
return true;
40+
});
41+
3042
return Promise.all(
31-
queryTags.map(async (queryTag) => {
43+
(queryTags as unknown as ElementArray).map(async (queryTag) => {
3244
const attributeTags = await queryTag.$$(
3345
'[data-testid="query-history-query-attribute"]'
3446
);
@@ -138,7 +150,7 @@ describe('Collection documents tab', function () {
138150
used_regex: false,
139151
});
140152

141-
const queries = await getRecentQueries(browser);
153+
const queries = await getRecentQueries(browser, true);
142154
expect(queries).to.deep.include.members([{ Filter: '{\n i: 5\n}' }]);
143155
});
144156

@@ -168,7 +180,7 @@ describe('Collection documents tab', function () {
168180
used_regex: false,
169181
});
170182

171-
const queries = await getRecentQueries(browser);
183+
const queries = await getRecentQueries(browser, true);
172184
expect(queries).to.deep.include.members([
173185
{
174186
Filter: '{\n i: {\n $gt: 5\n }\n}',
@@ -215,7 +227,7 @@ describe('Collection documents tab', function () {
215227
const displayText = await documentListActionBarMessageElement.getText();
216228
expect(displayText).to.equal('1 – 1 of 1');
217229

218-
const queries = await getRecentQueries(browser);
230+
const queries = await getRecentQueries(browser, true);
219231
expect(queries).to.deep.include.members([
220232
{
221233
Filter: "{\n $where: 'function() { return sleep(10000) || true; }'\n}",

packages/compass-e2e-tests/tests/collection-import.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,10 @@ describe('Collection import', function () {
11771177
const importModal = await browser.$(Selectors.ImportModal);
11781178
await importModal.waitForDisplayed();
11791179

1180+
// Wait for the import button to become available because detect can take
1181+
// a while
1182+
await browser.$(Selectors.ImportConfirm).waitForEnabled();
1183+
11801184
// Confirm import.
11811185
await browser.clickVisible(Selectors.ImportConfirm);
11821186

packages/compass-e2e-tests/tests/instance-sidebar.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ describe('Instance sidebar', function () {
121121
const collectionName = 'my-collection';
122122

123123
// open the create database modal from the sidebar
124-
await browser.clickVisible(Selectors.SidebarCreateDatabaseButton);
124+
await browser.clickVisible(Selectors.SidebarCreateDatabaseButton, {
125+
screenshot: 'before-can-create-a-database-and-drop-it-click.png',
126+
});
125127

126128
await browser.addDatabase(dbName, collectionName);
127129

0 commit comments

Comments
 (0)