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