Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grzpab committed Dec 1, 2023
1 parent 39b91eb commit 03911d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 12 additions & 4 deletions src/data/readHomeDirectoryCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ const readHomeDirectoryCase = async (
if (
!surfaceAgnosticCase.absoluteTargetPath.startsWith(rootUri.fsPath)
) {
console.log('HERE1');
console.info(
'The current case does not belong to the opened workspace',
);
fileEventEmitter.emit('close');
return;
}

if (!caseHashCodec.is(surfaceAgnosticCase.caseHashDigest)) {
console.log('HERE2');
console.error('Could not validate the case hash digest');
fileEventEmitter.emit('close');
return;
}
Expand All @@ -94,8 +96,14 @@ const readHomeDirectoryCase = async (
const jobHandler = (data: unknown) => {
const surfaceAgnosticJob = parseSurfaceAgnosticJob(data);

if (!kase || !jobHashCodec.is(surfaceAgnosticJob.jobHashDigest)) {
console.log('HERE3');
if (!kase) {
console.error('You need to have a case to create a job');
fileEventEmitter.emit('close');
return;
}

if (!jobHashCodec.is(surfaceAgnosticJob.jobHashDigest)) {
console.error('Could not validate the job hash digest');
fileEventEmitter.emit('close');
return;
}
Expand Down
14 changes: 3 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { buildContainer } from './container';
import { Command, MessageBus, MessageKind } from './components/messageBus';
import { JobManager } from './components/jobManager';
import { FileService } from './components/fileService';
import { Case, CaseHash, caseHashCodec } from './cases/types';
import { CaseHash, caseHashCodec } from './cases/types';
import { DownloadService } from './components/downloadService';
import { FileSystemUtilities } from './components/fileSystemUtilities';
import { EngineService } from './components/engineService';
Expand Down Expand Up @@ -45,11 +45,7 @@ import {
} from './data/codemodConfigSchema';
import { parsePrivateCodemodsEnvelope } from './data/privateCodemodsEnvelopeSchema';
import { GlobalStateTokenStorage, UserService } from './components/userService';
import {
HomeDirectoryService,
readHomeDirectoryCases,
} from './data/readHomeDirectoryCases';
import { Job } from './jobs/types';
import { HomeDirectoryService } from './data/readHomeDirectoryCases';

export const enum SEARCH_PARAMS_KEYS {
ENGINE = 'engine',
Expand Down Expand Up @@ -1264,11 +1260,7 @@ export async function activate(context: vscode.ExtensionContext) {
kind: MessageKind.bootstrapEngine,
});

const homeDirectoryService = new HomeDirectoryService(
messageBus,
store,
rootUri,
);
new HomeDirectoryService(messageBus, store, rootUri);

messageBus.publish({
kind: MessageKind.loadHomeDirectoryData,
Expand Down

0 comments on commit 03911d5

Please sign in to comment.