* Clear in-memory state for a workspace. * Useful for testing or cleanup after workspace deletion. * Does NOT delete disk file (use deleteInitStatus for that). * * Also cancels any running init promises to prevent orphaned waiters.
(workspaceId: string)
| 384 | * Also cancels any running init promises to prevent orphaned waiters. |
| 385 | */ |
| 386 | clearInMemoryState(workspaceId: string): void { |
| 387 | this.store.deleteState(workspaceId); |
| 388 | |
| 389 | // Cancel any running init promise for this workspace |
| 390 | const promiseEntry = this.initPromises.get(workspaceId); |
| 391 | if (promiseEntry) { |
| 392 | promiseEntry.reject(new Error(`Workspace ${workspaceId} was deleted`)); |
| 393 | promiseEntry.resolveHookPhase(); |
| 394 | this.initPromises.delete(workspaceId); |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | /** |
| 399 | * Wait for workspace initialization to complete. |
no test coverage detected