Skip to main content

repair_references

Function repair_references 

Source
pub fn repair_references(ents: &mut [Ent]) -> bool
Expand description

Drops references to things that no longer exist, after a merge.

A merge keeps a row only one writer touched, so a project one writer deleted and an entry another writer added to it merge cleanly row by row and leave the entry pointing at a project that is gone (the cascade that remaps projectIds only ever sees the writer’s own document). The same holds for a bundle dissolved while a member was being attached. Such an entry stays valid and visible: an unknown project id is removed (the entry falls back to Universal) and an unknown bundle_id is cleared, which turns the entry into an ordinary one. Returns whether anything changed.