Fix Groups messages export sanity test (#4775)
#### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [x] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
eb4f238502
commit
a66b500d90
@ -50,6 +50,20 @@ func CheckGroupsExport(
|
|||||||
envs)
|
envs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func removeDeletedMessages(
|
||||||
|
ctx context.Context,
|
||||||
|
tree *common.Sanitree[models.Channelable, models.ChatMessageable],
|
||||||
|
) {
|
||||||
|
for _, child := range tree.Children {
|
||||||
|
for _, leaf := range child.Leaves {
|
||||||
|
if leaf.Self.GetDeletedDateTime() != nil {
|
||||||
|
delete(child.Leaves, leaf.ID)
|
||||||
|
child.CountLeaves--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func checkChannelMessagesExport(
|
func checkChannelMessagesExport(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
ac api.Client,
|
ac api.Client,
|
||||||
@ -82,6 +96,8 @@ func checkChannelMessagesExport(
|
|||||||
common.CompareLeaves(ctx, expect.Leaves, updatedResultLeaves, nil)
|
common.CompareLeaves(ctx, expect.Leaves, updatedResultLeaves, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeDeletedMessages(ctx, sourceTree)
|
||||||
|
|
||||||
common.CompareDiffTrees(
|
common.CompareDiffTrees(
|
||||||
ctx,
|
ctx,
|
||||||
sourceTree,
|
sourceTree,
|
||||||
@ -146,6 +162,7 @@ func populateMessagesSanitree(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, msg := range filteredMsgs {
|
for _, msg := range filteredMsgs {
|
||||||
|
child.CountLeaves++
|
||||||
child.Leaves[ptr.Val(msg.GetId())] = &common.Sanileaf[
|
child.Leaves[ptr.Val(msg.GetId())] = &common.Sanileaf[
|
||||||
models.Channelable,
|
models.Channelable,
|
||||||
models.ChatMessageable,
|
models.ChatMessageable,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user