fix(recompute): refresh a reader's derived values when its read peer is deleted#9845
Draft
gmazoyer wants to merge 1 commit into
Draft
fix(recompute): refresh a reader's derived values when its read peer is deleted#9845gmazoyer wants to merge 1 commit into
gmazoyer wants to merge 1 commit into
Conversation
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 8, 2026 09:54
d890bf0 to
b2c86e4
Compare
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 8, 2026 10:06
b2c86e4 to
7885f27
Compare
Contributor
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 3/5
- In
backend/infrahub/core/merge/recompute_coalescing.py, unscopedUPDATEDchanges can skip the reader-by-own-id recompute when the unrecorded change is relationship-only, because_changed_relationship_fields()may returnNonewhenchanged_fieldsis empty; merging as-is risks stale or incorrect read results after merges. Ensure relationship-only updates are treated as relationship changes (instead ofNone) and add a regression test for the unscopedUPDATEDpath before merging.
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 8, 2026 10:33
7885f27 to
6f9c427
Compare
gmazoyer
force-pushed
the
coalesce-merge-recompute-ifc-2761
branch
2 times, most recently
from
July 12, 2026 11:27
d0c528c to
870a3b7
Compare
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 12, 2026 11:38
6f9c427 to
e574a26
Compare
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
4 times, most recently
from
July 17, 2026 09:48
4e842db to
d7ab2f3
Compare
…is deleted Deleting a node that others read across a relationship left the readers with derived values that still named the deleted peer after a merge or rebase. The reader appears in the change set as an update whose changed field is the relationship, but the coalesced deriver treated updates as needing no self recompute (the node is assumed to have refreshed its own values inline on save), which a peer deletion never triggers; the only submission was a reverse lookup from the deleted peer, which finds no readers once its edges are closed. An update whose changed fields include a relationship now also recomputes the node's own derived values that read across it, keyed by the node's own id. This covers merge and rebase through the shared deriver. Attribute-only updates are unchanged, so the coalescing behavior for the common case is preserved.
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 17, 2026 12:30
d7ab2f3 to
6a127f1
Compare
gmazoyer
force-pushed
the
recompute-deleted-peer-readers-ifc-2852
branch
from
July 17, 2026 12:59
6a127f1 to
694204d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Deleting a node that other nodes read across a relationship left the readers with derived values (display label, human-friendly id, computed attribute) that still named the deleted peer after a merge or rebase. Tracked in IFC-2852.
Root cause
The reader does appear in the merge/rebase change set, but as an update whose changed field is the relationship to the deleted peer. The coalesced deriver treated updates as needing no self recompute, on the assumption the node refreshed its own derived values inline on the save that recorded the change. A peer deletion never triggers that inline recompute (the reader is not saved, its edge is closed from the peer side). The only submission was a reverse lookup from the deleted peer, which finds no readers once its edges are closed, so the reader kept its stale value.
Fix
An update whose changed fields include a relationship now also recomputes the node's own derived values that read across it, keyed by the node's own id. This works because the reader still exists. It covers both merge and rebase through the shared
build_coalesced_recompute. Attribute-only updates are unchanged, so the coalescing behavior for the common case is preserved.Tests
test_deleting_read_peer_refreshes_reader_after_mergeto assert the computed attribute and display label stop naming the deleted peer and the human-friendly id (local name only) is unchanged, using the full cross-relationship display label.test_merge_submits_delete_peer.py: a component test asserting the reader is recomputed by its own id for the computed attribute and display label.Notes
coalesce-merge-recompute-ifc-2761(Coalesce merge and rebase recompute #9751); will retarget to develop if that merges first.Summary by cubic
Refreshes a reader’s computed attribute, display label, and HFID when its relationship changes during merge/rebase—including when the peer is deleted—so values stop naming the deleted node (IFC-2852). Adds a safe fallback for unscoped updates that also recomputes the node’s own derived values.
UPDATEDwith relationship fields also recomputes the reader’s own derived values, keyed by its id; attribute-only updates unchanged.UPDATEDimprecisely recomputes cross-node readers and the node’s own derived values.Written for commit 694204d. Summary will update on new commits.