Preserve child identity in inheritance history
This commit is contained in:
@@ -25,6 +25,12 @@ func appendInheritanceExplanation(explanation *Explanation, working **document.N
|
||||
}
|
||||
before := valueSnapshot(*working, query, secrets)
|
||||
replaceHistoryPath(working, operation.transfer.to, operation.parent)
|
||||
// A record keeps its own identity throughout inheritance. Restore it
|
||||
// before taking enclosing snapshots as well as direct field snapshots.
|
||||
for _, field := range operation.identityFields {
|
||||
identity, _ := documentAtPath(operation.effective, Keys(field))
|
||||
replaceHistoryPath(working, operation.transfer.to.Key(field), identity)
|
||||
}
|
||||
afterParent := valueSnapshot(*working, query, secrets)
|
||||
parent, parentPresent := transferredOperationOrigin(operation, operationPathForQuery(operation.transfer.to, query))
|
||||
if pathsIntersect(operation.transfer.to, query) && parentPresent {
|
||||
|
||||
Reference in New Issue
Block a user