Skip to content

Commit 4f7c98a

Browse files
committed
remove all references since they are re-added later
1 parent 094fbd9 commit 4f7c98a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/hypergraph/src/entity/findMany.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,12 @@ const subscribeToDocumentChanges = (handle: DocHandle<DocumentContent>) => {
6666
cacheEntry.entities.set(entityId, decoded);
6767

6868
if (oldDecodedEntry) {
69-
// collect all the Ids for relation entries that don't exist in the `decoded` entry, but did in the `oldDecodedEntry`
69+
// collect all the Ids for relation entries in the `oldDecodedEntry`
7070
const deletedRelationIds = new Set<string>();
71-
for (const [fieldName, value] of Object.entries(oldDecodedEntry)) {
71+
for (const [, value] of Object.entries(oldDecodedEntry)) {
7272
if (Array.isArray(value)) {
7373
for (const relationEntity of value) {
74-
// @ts-expect-error decoded is a valid object
75-
if (!decoded[fieldName]?.includes(relationEntity.id)) {
76-
deletedRelationIds.add(relationEntity.id);
77-
}
74+
deletedRelationIds.add(relationEntity.id);
7875
}
7976
}
8077
}

0 commit comments

Comments
 (0)