MM-24707 fix reply import bug (#14442)
Этот коммит содержится в:
@@ -1267,8 +1267,6 @@ func (a *App) importMultiplePosts(data []*PostImportData, dryRun bool) *model.Ap
|
||||
return err
|
||||
}
|
||||
|
||||
var lastPostWithData *postAndData
|
||||
repliesBulk := []ReplyImportData{}
|
||||
for _, postWithData := range postsWithData {
|
||||
postWithData := postWithData
|
||||
if postWithData.postData.FlaggedBy != nil {
|
||||
@@ -1301,27 +1299,14 @@ func (a *App) importMultiplePosts(data []*PostImportData, dryRun bool) *model.Ap
|
||||
}
|
||||
}
|
||||
|
||||
if postWithData.postData.Replies != nil {
|
||||
repliesBulk = append(repliesBulk, *postWithData.postData.Replies...)
|
||||
if len(repliesBulk) >= importMultiplePostsThreshold {
|
||||
err := a.importReplies(repliesBulk, postWithData.post, postWithData.team.Id, dryRun)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repliesBulk = []ReplyImportData{}
|
||||
if postWithData.postData.Replies != nil && len(*postWithData.postData.Replies) > 0 {
|
||||
err := a.importReplies(*postWithData.postData.Replies, postWithData.post, postWithData.team.Id, dryRun)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
a.updateFileInfoWithPostId(postWithData.post)
|
||||
lastPostWithData = &postWithData
|
||||
}
|
||||
|
||||
if len(repliesBulk) >= 0 && lastPostWithData != nil {
|
||||
err := a.importReplies(repliesBulk, lastPostWithData.post, lastPostWithData.team.Id, dryRun)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user