# Support merging of 2 topics with voting

**URL:** https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482
**Category:** Feature
**Tags:** rest-api
**Created:** [2 ביוני,‏ 2016,‏ 4:11pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482 "2016-06-02T16:11:46Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [2 ביוני,‏ 2016,‏ 4:11pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/1 "2016-06-02T16:11:46Z")

</div>

I had people two topics in a voting category which were essentially the same request, so I merged all comments from `Topic B` to `Topic A`, and now `Topic A` has no votes.

Has anyone seen an issue where votes on `Topic A` are lost/reset after moving a number of commits into it from `Topic B`?

I think I did, but don’t know if there’s any place I can tell if a `Topic A` ever got votes. If they were logged anywhere, I’d love to know so I can check.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [6 במרץ,‏ 2017,‏ 4:45pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/2 "2017-03-06T16:45:54Z")

</div>

Agree we should fix this, for now #pr-welcome

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [28 ביולי,‏ 2018,‏ 4:35pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/3 "2018-07-28T16:35:38Z")

</div>

Hello,

This [PR](https://github.com/discourse/discourse-voting/pull/30) should fix this.

Let’s say we have topics A and B. When topic A is merged into topic B, all users who voted topic A will automatically vote B and their votes for A will be removed.

---

<div class="post-metadata">

### Author: ![alexs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexs/32/139956_2.png) [@alexs](https://meta.discourse.org/u/alexs)
#### Post date: [22 בספטמבר,‏ 2018,‏ 9:37pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/4 "2018-09-22T21:37:31Z")

</div>

Are there any exceptions to this rule? I’ve noticed some inconsistent behaviour e.g. when I merged this topic:

[Community Notice | Freetrade](https://community.freetrade.io/t/let-users-specify-number-of-shares-while-buying/1683)

into this one:

[Community Notice | Freetrade](https://community.freetrade.io/t/buy-an-specific-number-of-shares-rather-than-a-amount/1486/)

not all of the votes were carried across the latter topic. IIRC only 16 made it across.

---

<div class="post-metadata">

### Author: ![JaredH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaredh/32/144878_2.png) [@JaredH](https://meta.discourse.org/u/JaredH)
#### Post date: [14 ביוני,‏ 2019,‏ 5:16pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/5 "2019-06-14T17:16:31Z")

</div>

Yes, I’ve experienced the same thing. We’re regularly merging topics. Our process is to merge to the oldest topic to preserve the chronological order of the posts. When this happen we lose the votes for the other topics.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [3 ביולי,‏ 2019,‏ 2:06pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/6 "2019-07-03T14:06:35Z")

</div>

@dan any ideas about these issues?

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [7 ביולי,‏ 2019,‏ 3:02pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/8 "2019-07-07T15:02:41Z")

</div>

There is one exception I can think of.

Let’s say we have two topics: A and B, each with 100 votes, but 20 of the users who voted for A also voted B. If the two topics are merged, it is not guaranteed that the final topic will have 200 votes because there might be some users who voted on both of the topics and the votes will not be duplicated.

The final count will be = `users count who voted A` + `users count who voted B` - `users count who voted both A and B`. In the example above (100 + 100 - 20 = 180).

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [11 באוגוסט,‏ 2019,‏ 5:46pm UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/9 "2019-08-11T17:46:05Z")

</div>

I have made a few changes here and just submitted a pull request to make things clearer. After this pull request will be accepted, the moderator post that is added to the original topic will be edited to contain how many votes were moved and how many votes were not moved (because user already voted for the  
destination topic).

 ![48](https://global.discourse-cdn.com/meta/original/3X/c/4/c4d01a92786eb838a38a2adf99c5593eb430a020.png)

[https://github.com/discourse/discourse-voting/pull/42](https://github.com/discourse/discourse-voting/pull/42)

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [7 ביולי,‏ 2020,‏ 9:02am UTC](https://meta.discourse.org/t/support-merging-of-2-topics-with-voting/58482/10 "2020-07-07T09:02:02Z")

</div>


