MCPcopy
hub / github.com/coder/mux / readPartial

Method readPartial

src/node/services/historyService.ts:1159–1173  ·  view source on GitHub ↗

* Read the partial message for a workspace, if it exists.

(workspaceId: string)

Source from the content-addressed store, hash-verified

1157 * Read the partial message for a workspace, if it exists.
1158 */
1159 async readPartial(workspaceId: string): Promise<MuxMessage | null> {
1160 try {
1161 const partialPath = this.getPartialPath(workspaceId);
1162 const data = await fs.readFile(partialPath, "utf-8");
1163 const message = JSON.parse(data) as MuxMessage;
1164 return normalizeLegacyMuxMetadata(message);
1165 } catch (error) {
1166 if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
1167 return null;
1168 }
1169
1170 log.error("Error reading partial:", error);
1171 return null;
1172 }
1173 }
1174
1175 /**
1176 * Write a partial message to disk.

Calls 4

getPartialPathMethod · 0.95
readFileMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected