(workspaceId: string)
| 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, |
no test coverage detected