Add quiescent canonical recovery sessions without rewriting requests
This commit is contained in:
@@ -114,6 +114,12 @@ export function createFoundryPersistence(options: { workspaceId: Id; rootId: Id;
|
||||
}
|
||||
return Object.freeze({
|
||||
supportsRequest: (request: FrozenRequest) => request.protocolVersion === 2,
|
||||
async read(signal: AbortSignal) {
|
||||
const loaded=await loadFoundryModel(options.transport,options.workspaceId,options.rootId,options.registry,signal);
|
||||
if(loaded.status!=='ready')throw fault('canonical_migration_required');
|
||||
if(loaded.document.projectId!==options.rootId)throw fault('project_mismatch');
|
||||
return loaded;
|
||||
},
|
||||
compile(intent: OperationIntent, requestId: Id, snapshot: EngineSnapshot) {
|
||||
if (snapshot.document.projectId !== options.rootId || !uuid.test(intent.id) || !uuid.test(requestId) || intent.operationType !== 'document.change' || intent.operationSchemaVersion !== 1) throw fault('operation_interpreter_unavailable');
|
||||
const canvasIds = [...new Set(intent.canvasIds)].sort(), expectedVersions: Record<Id, number> = {};
|
||||
|
||||
Reference in New Issue
Block a user