Visitar URL original
History: a delta hangs from the document's own file when it has no mo… · ThatOpen/platform_services@5c99ead · GitHub
Skip to content

Commit 5c99ead

Browse files
agviegasclaude
andcommitted
History: a delta hangs from the document's own file when it has no model .frag
An IFC edited in the modeller has no .frag in its folder, so every sync with a delta was refused whole and its version was in no step at all. Deltas are read back by deltaId alone, so the file they hang from is free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ed33210 commit 5c99ead

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/core/history.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -781,16 +781,16 @@ export class FlowDoc {
781781
version.full = true;
782782
}
783783
if (input.delta) {
784-
const modelFile = await this.#modelFile();
785-
if (!modelFile) {
784+
// A document whose own file is no .frag (an IFC edited in the modeller) has no model file: its delta hangs from
785+
// the file the version is of, which is the document's own. Read back by `deltaId` alone, so either does.
786+
const hangsFrom =
787+
(await this.#modelFile())?.id ?? input.file?.fileId ?? undefined;
788+
if (!hangsFrom) {
786789
throw new Error(
787790
'A delta needs the model file to hang from: sync a full model first.',
788791
);
789792
}
790-
const hidden = await this.client.createHiddenFile(
791-
input.delta,
792-
modelFile.id,
793-
);
793+
const hidden = await this.client.createHiddenFile(input.delta, hangsFrom);
794794
version.deltaId = hiddenIdOf(hidden);
795795
}
796796

0 commit comments

Comments
 (0)