(workspaceId: string)
| 2439 | } |
| 2440 | |
| 2441 | async acknowledgeUser(workspaceId: string): Promise<GoalRecordV1 | null> { |
| 2442 | assert(workspaceId.trim().length > 0, "acknowledgeUser requires workspaceId"); |
| 2443 | return this.fileLocks.withLock(workspaceId, async () => { |
| 2444 | const current = await this.readGoalFile(workspaceId); |
| 2445 | if (!current) { |
| 2446 | await this.pushSnapshot(workspaceId, null); |
| 2447 | return null; |
| 2448 | } |
| 2449 | if (current.requireUserAcknowledgmentSinceMs == null) { |
| 2450 | await this.pushSnapshot(workspaceId, current); |
| 2451 | return current; |
| 2452 | } |
| 2453 | |
| 2454 | const next = this.applyMutableFields(current, { |
| 2455 | workspaceId, |
| 2456 | requireUserAcknowledgmentSinceMs: null, |
| 2457 | }); |
| 2458 | await this.writeGoal(workspaceId, next); |
| 2459 | await this.pushSnapshot(workspaceId, next); |
| 2460 | return next; |
| 2461 | }); |
| 2462 | } |
| 2463 | |
| 2464 | async requireUserAcknowledgmentForCrashRecovery( |
| 2465 | workspaceId: string, |
no test coverage detected