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

Method delete

src/node/utils/sessionFile.ts:96–110  ·  view source on GitHub ↗

* Delete JSON file from workspace session directory with file locking. * Idempotent - no error if file doesn't exist.

(workspaceId: string)

Source from the content-addressed store, hash-verified

94 * Idempotent - no error if file doesn't exist.
95 */
96 async delete(workspaceId: string): Promise<Result<void>> {
97 return this.fileLocks.withLock(workspaceId, async () => {
98 try {
99 const filePath = this.getFilePath(workspaceId);
100 await fs.unlink(filePath);
101 return Ok(undefined);
102 } catch (error) {
103 if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
104 return Ok(undefined); // Already deleted
105 }
106 const message = getErrorMessage(error);
107 return Err(`Failed to delete ${this.fileName}: ${message}`);
108 }
109 });
110 }
111}

Callers 15

resolveGlobalKeyMethod · 0.45
deleteStateMethod · 0.45
deletePersistedMethod · 0.45
clearCompletedMethod · 0.45
finishMethod · 0.45
resolveEncodingFunction · 0.45
countTokensInternalFunction · 0.45
workerPool.tsFile · 0.45
withLockMethod · 0.45
handlePromptFunction · 0.45
acquireConnectionMethod · 0.45

Calls 5

getFilePathMethod · 0.95
OkFunction · 0.90
getErrorMessageFunction · 0.90
ErrFunction · 0.90
withLockMethod · 0.80

Tested by

no test coverage detected