fix(notification-trigger): seed default collaborators onto the parent doc, not the attached tx#10975
Open
MichaelUray wants to merge 1 commit into
Open
Conversation
… doc, not the attached tx getCollaborators resolved the default collaborators of the parent doc (loaded via the triggering tx's attachedTo/attachedToClass) but seeded them onto tx.objectId — the attached child item (a comment/message create/update/remove tx). The parent's collaborators therefore landed on the child record instead of the parent. Seed onto doc._id/doc._class/doc.space instead. Same class of bug as the chunter seed-target fix. The returned collaborator list is unchanged; only the target of the newly created Collaborator records changes. Adds a unit test that drives getCollaborators directly: real getAddCollaboratTxes/getDocCollaborators, only getClassCollaborators stubbed. Parent and child are given distinct collaborators and spaces; it asserts the seed targets the parent (attachedTo/attachedToClass/objectSpace), never the child, while the returned collaborator list stays identical. Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
|
Connected to Huly®: UBERF-16658 |
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.
Summary
Fixes default collaborators being seeded onto an attached child document instead of the parent document whose collaborators were resolved.
In
collectionCollabDoc(),docis loaded through the child transaction'sattachedToandattachedToClass.getCollaborators()computes the defaults for that parent, but the seed path passed the child transaction'sobjectId,objectClass, andobjectSpacetogetAddCollaboratTxes().Fix
Seed using
doc._id,doc._class, anddoc.space.The returned collaborator list is unchanged; only the target of newly created
Collaboratorrecords changes.The other two
getAddCollaboratTxes()call sites innotification-resourcesalready receive the document they operate on and remain unchanged.Tests
Adds a focused
notification-resourcesregression test that:getDocCollaborators()andgetAddCollaboratTxes()normally;attachedTo,attachedToClass, andobjectSpacereference the parent;The test fails before the fix with
attachedTo = child-itemand passes after it.Existing data
This change prevents new misplaced records. Existing records cannot be safely distinguished from legitimate child collaborators because they carry no provenance, so this PR does not attempt a data cleanup.
Related
Same wrong-target class as #10973, covering the independent
notification-resourcespath.