Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/client/datascience/interactive-ipynb/digestStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { inject, injectable } from 'inversify';
import * as os from 'os';
import * as path from 'path';
import { Uri } from 'vscode';
import { traceError } from '../../common/logger';
import { traceError, traceInfo } from '../../common/logger';
import { isFileNotFoundError } from '../../common/platform/errors';
import { IFileSystem } from '../../common/platform/types';
import { IExtensionContext } from '../../common/types';
Expand All @@ -14,6 +14,7 @@ import { IDigestStorage } from '../types';
export class DigestStorage implements IDigestStorage {
public readonly key: Promise<string>;
private digestDir: Promise<string>;
private loggedFileLocations = new Set();

constructor(
@inject(IFileSystem) private fs: IFileSystem,
Expand All @@ -27,6 +28,10 @@ export class DigestStorage implements IDigestStorage {
const fileLocation = await this.getFileLocation(uri);
// Since the signature is a hex digest, the character 'z' is being used to delimit the start and end of a single digest
await this.fs.appendFile(fileLocation, `z${signature}z\n`);
if (!this.loggedFileLocations.has(fileLocation)) {
traceInfo(`Wrote trust for ${uri.toString()} to ${fileLocation}`);
this.loggedFileLocations.add(fileLocation);
}
}

public async containsDigest(uri: Uri, signature: string) {
Expand Down