···6767 textData.value = base64.fromByteArray(updateBytes);
6868 }
6969 }
7070+ } else if (f.id) {
7171+ // For cardinality "many" with an explicit ID, fetch the existing fact
7272+ // so undo can restore it instead of deleting
7373+ let fact = await tx.get(f.id);
7474+ if (fact) {
7575+ existingFact = [fact as Fact<any>];
7676+ }
7077 }
7178 if (!ignoreUndo)
7279 undoManager.add({