Commit Graph

6 Commits

Author SHA1 Message Date
David Taylor 1284196081
DEV: Introduce syntax_tree for ruby formatting (#138) 2022-12-29 13:35:59 +01:00
Justin DiRose c82d5a6645
FIX: Stop trying to merge duplicate votes (#56)
Was able to reproduce a bug where votes were not properly moved when merging two topics together. We were only checking duplicate votes if either both votes were either active or archived, and not a mix of the two. As a result, there were cases where the plugin was trying to move votes that already existed on an open topic, causing the merge to partially fail with a duplicate index error.

What this commit does is as follows:

- Cleaned up the logic so it's more readable. Previously it was duplicative and difficult to read.
- We're now checking if a user has a vote on Topic A (active or archived) and Topic B (active or archived) that we're properly deleting the origin vote and keeping the destination vote instead of trying to merge in a duplicate. (This caused the original bug described above).
- Per the specs on meta, topic merges move all votes to the destination topic, and if this causes a user to go over the limit, they'll have to wait until enough votes are released.
- If the destination topic is closed, the votes will be archived; if the destination topic is open, those votes will be active. This is regardless of origin vote state.

Also, the Gemfile was missing a source declaration to allow installation of gems/dependencies, so I've added that.
2020-09-17 11:02:19 -05:00
Discourse Translator Bot 6605e5d3da DEV: Switch from Transifex to Crowdin 2020-07-16 14:01:38 +02:00
Jarek Radosz e642fdf6fd DEV: Add rubocop-discourse gem 2020-05-06 18:14:42 +02:00
Guo Xiang Tan 14b6603150 Add frozen string literal comment to files. 2019-05-13 11:11:19 +08:00
Neil Lalonde 1450920027 Transifex integration 2017-12-04 15:47:07 -05:00