Replies not imported correctly for bulk imports


When doing a bulk-import (jsonl) replies to post are not imported correctly. Error reported is `Reply CreateAt property must be greater than the parent post CreateAt.`

This is a regression in 5.22.

Root cause is an optimization added in 5.22 which batch adds the replies. Unfortunately the logic is in error and mismatches the replies with the posts. Occasionally this will result in no error but the reply will appear under the wrong post. More often the reply will generate the error above, depending on the time stamp of the last post in every 1000 post batch.

QA Test Steps

1. Run the following CLI command in server: `bin/mattermost import bulk <bulk-import.json> --apply`. The bulk-import file can be stored anywhere, and the file path can be used in the cli command.
2. Once the import is completed, find the new team that's created by the import and find the test channel.
3. Verify that messages and replies are imported correctly on the center channel view.
4. Verify that messages and replies appear correctly on reply threads.


Prapti Shrestha
May 4, 2020, 10:01 PM

Verified in prev.test (updated to 5.22.2-rc1) that all messages and replies show as expected.

Prapti Shrestha
May 1, 2020, 7:45 PM

Tested and verified on local. Bulk import works as expected with correctly imported replies.

Prapti Shrestha
May 1, 2020, 7:38 PM

If this one could be changed to Resolved, I can go ahead and close it

Doug Lauder
April 30, 2020, 9:53 PM


Your pinned fields
Click on the next to a field label to start pinning.


Doug Lauder

QA Assignee

Prapti Shrestha


Doug Lauder

Fix versions

Mattermost Team

Sustained Engineering


QA Testing Areas