Transfer likes when moving a new topic into an existing one

I just noticed that when moving a topic (not a reply) into another topic that already existed, the moved topic will lose its likes. Here’s an actual example of a topic that was merged into an existing one.

This happens because when we merge a topic into another one, we don’t actually move that topic, instead we close it and make a duplicate of it in the other topic.

This inadvertently strips the topic of its likes. Could we:

  • migrate the likes from the “moved” topic to the new post, and
  • remove the likes from the “moved” topic?

I realise this is more complicated than moving replies, but since moved replies do retain their likes, there’s an unexpected inconsistency here.

7 Likes

FYI, this was noted back in Nov '14, but may have been missed in the noise
https://meta.discourse.org/t/moving-the-first-post-to-a-different-topic-doesnt-actually-move-the-post-it-copies-it/15321/19?u=cpradio

5 Likes

I’ve been working on this today and created a PR: https://github.com/discourse/discourse/pull/4701.

I just now found out that my approach is different from the approach proposed here. Here it is proposed that the likes are moved, I copied them instead.

3 Likes

Hi @deivid-rodriguez, sorry for the late review here. I just merged your PR in

https://github.com/discourse/discourse/commit/934bff43d9c69820b60879931fd40890f290a59e

with some minor tweaks. Thank you for the great work :thumbsup:

8 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

So this is specific to merging two topics? And we are taking about the first post of one topic being merged into another topic, that first post loses its likes in the target topic?