Merging very long posts removes them

I had a user that posted a single post with some text, then two very long posts that contain logs, and finally another post asking for help. I tried to merge these four posts. After I selected all four posts and clicked merge, only the last post of the selection remained without merging any other post to the last one. Others were marked as removed. I restored the posts and tried again but got the same result.

I have 2.7.0.beta5 (5c84f702b0) installed.

3 Likes

Together are the longer than the max post length? (does sound like a bug to me)

3 Likes

Probably. I think that’s also why the user posted the logs in two different posts.

2 Likes

How long were these posts exactly?

Their raw sizes are:
1st post: 101 characters
2nd post: 28007 characters
3rd post: 21840 characters
4th post: 21 characters

3 Likes

OK, can we repro this @dax?

3 Likes

Yes, I can repro it.

The merge fails silently (there are no errors either in the console or in the logs) and the posts are soft-deleted but not merged.

As @pfaffman pointed out, the problem is that such long posts, due to the max post length site setting (set by default to 32.000 characters), cannot be merged and the error should be displayed indicating that the merge cannot be done because the number of characters is higher than those allowed.

8 Likes

Ouch this is not ideal at all @techAPJ can you fix? An error message seems fine to me.

5 Likes

We’ll now show an error bootbox instead of failing silently and will not soft-delete posts, via:

https://github.com/discourse/discourse/commit/c478ffc6620cdc83c2a7e830b05b7cb7354663f3

Thanks for reporting this issue @ggurbet :+1:

6 Likes