Implemented reverse-edge handling for cascade-deleted nodes in the de…#20
Implemented reverse-edge handling for cascade-deleted nodes in the de…#20vschmittprisma wants to merge 4 commits into
Conversation
…pendent graph, enhancing filter logic to prevent incorrect existence checks for deleted nodes.
|
With the publisher selection tags { tag { id brandedContents(where:{isActive:true}){ brandKey } } }, the dependency path is Article → tags (reverse-edge) → tag (edge) → brandedContents (reverse-edge). A cascading Tag deletion emits NodeDeletion(Tag) + N×NodeDeletion(ArticleTag) + M×NodeDeletion(TagBrandedContent) in one change-set. The brandedContents reverse-edge maps each NodeDeletion(TagBrandedContent) (via its originalEdge → Tag) into a tail re-read filter Tag{id:900}. That bubbles up into EdgeExists(tag, Tag{id:900}) → tags_some: { tag: { id: 900 } } → EXISTS articleTag WHERE tagIntId=900 — redundant (the articles are already in _id_in) and a full-scan trigger. I reproduced exactly that on current main: { "OR": [ { "_id_in": [11,22,33] }, { "tags_some": { "tag": { "id": "…900" } } } ] } The fix (dependent-graph.ts) Result on the repro: upsertFilter = { _id_in: [11, 22, 33] }. |
…attened dependencies, ensuring accurate broker delivery.
…and fix filter logic to prevent crashes
…pendent graph, enhancing filter logic to prevent incorrect existence checks for deleted nodes.