diff --git a/src/server/snapshot/snapshotRenderer.ts b/src/server/snapshot/snapshotRenderer.ts index aa13f6dc16..30d18d82ec 100644 --- a/src/server/snapshot/snapshotRenderer.ts +++ b/src/server/snapshot/snapshotRenderer.ts @@ -138,7 +138,7 @@ function snapshotScript() { for (const iframe of root.querySelectorAll('iframe')) { const src = iframe.getAttribute('src'); if (!src) { - iframe.setAttribute('src', 'data:text/html,
Snapshot is not available'); + iframe.setAttribute('src', 'data:text/html,'); } else { // Append query parameters to inherit ?name= or ?time= values from parent. iframe.setAttribute('src', window.location.origin + src + window.location.search); diff --git a/src/server/snapshot/snapshotServer.ts b/src/server/snapshot/snapshotServer.ts index 40a1edd9ac..57e8d02747 100644 --- a/src/server/snapshot/snapshotServer.ts +++ b/src/server/snapshot/snapshotServer.ts @@ -75,7 +75,7 @@ export class SnapshotServer { } function respondNotAvailable(): Response { - return new Response('Snapshot is not available', { status: 200, headers: { 'Content-Type': 'text/html' } }); + return new Response('', { status: 200, headers: { 'Content-Type': 'text/html' } }); } function removeHash(url: string) { diff --git a/src/server/supplements/recorder/recorderTypes.ts b/src/server/supplements/recorder/recorderTypes.ts index 3c84726a82..372e16916a 100644 --- a/src/server/supplements/recorder/recorderTypes.ts +++ b/src/server/supplements/recorder/recorderTypes.ts @@ -30,11 +30,13 @@ export type UIState = { snapshotUrl?: string; }; +export type CallLogStatus = 'in-progress' | 'done' | 'error' | 'paused'; + export type CallLog = { id: number; title: string; messages: string[]; - status: 'in-progress' | 'done' | 'error' | 'paused'; + status: CallLogStatus; error?: string; reveal?: boolean; duration?: number; @@ -44,7 +46,7 @@ export type CallLog = { }; snapshots: { before: boolean, - in: boolean, + action: boolean, after: boolean, } }; diff --git a/src/server/supplements/recorder/recorderUtils.ts b/src/server/supplements/recorder/recorderUtils.ts new file mode 100644 index 0000000000..7fe390778b --- /dev/null +++ b/src/server/supplements/recorder/recorderUtils.ts @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CallMetadata } from '../../instrumentation'; +import { CallLog, CallLogStatus } from './recorderTypes'; + +export function metadataToCallLog(metadata: CallMetadata, status: CallLogStatus, snapshots: Set