Skip to content

Commit f674240

Browse files
authored
Remove Studio data request failed Toast (#5125)
1 parent 0e6c5be commit f674240

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

extension/src/experiments/data/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { COMMITS_SEPARATOR, gitPath } from '../../cli/git/constants'
2626
import { getGitPath } from '../../fileSystem'
2727
import { ExperimentsModel } from '../model'
2828
import { Studio } from '../studio'
29-
import { Toast } from '../../vscode/toast'
3029

3130
export class ExperimentsData extends BaseData<ExperimentsOutput> {
3231
private readonly experiments: ExperimentsModel
@@ -157,9 +156,6 @@ export class ExperimentsData extends BaseData<ExperimentsOutput> {
157156
})
158157
} catch {
159158
this.notifyChanged(defaultData)
160-
void Toast.showError(
161-
`Unable to fetch data from [Studio](${this.studio.getInstanceUrl()}).`
162-
)
163159
}
164160
}
165161

extension/src/test/suite/experiments/data/index.test.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
} from '../../../../data'
3636
import { Studio } from '../../../../experiments/studio'
3737
import { DEFAULT_STUDIO_URL } from '../../../../setup/webview/contract'
38-
import { Toast } from '../../../../vscode/toast'
3938

4039
const MOCK_WORKSPACE_GIT_FOLDER = join(dvcDemoPath, '.mock-git')
4140

@@ -410,43 +409,5 @@ suite('Experiments Data Test Suite', () => {
410409
}
411410
)
412411
})
413-
414-
it('should show a toast if the request to Studio fails', async () => {
415-
const mockStudioToken = 'isat_BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'
416-
const mockSelfHostedStudioUrl = 'https://studio.example.com'
417-
const { data, mockFetch } = buildExperimentsData(
418-
disposable,
419-
'* main',
420-
gitLogFixture,
421-
mockStudioToken,
422-
mockSelfHostedStudioUrl
423-
)
424-
const mockToast = stub(Toast, 'showError')
425-
426-
mockFetch.onFirstCall().callsFake(() => {
427-
throw new Error('request failed')
428-
})
429-
430-
const requestSent = new Promise(resolve =>
431-
data.onDidUpdate(data => {
432-
if (isStudioExperimentsOutput(data)) {
433-
resolve(undefined)
434-
expect(data).to.deep.equal({
435-
live: [],
436-
pushed: [],
437-
view_url: mockBaseStudioUrl
438-
})
439-
}
440-
})
441-
)
442-
443-
await data.isReady()
444-
445-
await requestSent
446-
447-
expect(mockToast).to.be.calledWithExactly(
448-
`Unable to fetch data from [Studio](${mockSelfHostedStudioUrl}).`
449-
)
450-
})
451412
})
452413
})

0 commit comments

Comments
 (0)