MCPcopy Index your code
hub / github.com/coder/mux / readGoalFile

Method readGoalFile

src/node/services/workspaceGoalService.ts:690–708  ·  view source on GitHub ↗
(workspaceId: string)

Source from the content-addressed store, hash-verified

688 }
689
690 private async readGoalFile(workspaceId: string): Promise<GoalRecordV1 | null> {
691 const filePath = this.getFilePath(workspaceId);
692 let raw: string;
693 try {
694 raw = await fs.readFile(filePath, "utf-8");
695 } catch (error) {
696 if (isNotFound(error)) {
697 return null;
698 }
699 throw error;
700 }
701
702 try {
703 return GoalRecordV1Schema.parse(JSON.parse(raw));
704 } catch (error) {
705 await this.renameCorruptGoal(workspaceId, filePath, error);
706 return null;
707 }
708 }
709
710 private async pushSnapshot(
711 workspaceId: string,

Callers 15

normalizeGoalLimitsMethod · 0.95
inheritFromForkMethod · 0.95
setGoalInternalMethod · 0.95
setGoalImmediatelyMethod · 0.95
acknowledgeUserMethod · 0.95

Calls 5

getFilePathMethod · 0.95
renameCorruptGoalMethod · 0.95
isNotFoundFunction · 0.85
readFileMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected