mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 13:08:40 +08:00
Previously, `PostMover` detected a full merge by comparing the sizes of two differently-filtered post sets — a topic-wide census (`regular OR (whisper AND action_code != 'split_topic')`, with no content filter and a NULL-unsafe `!=`) against the movable set (which excludes `small_action` and blank-`raw` posts). Any post the two filters classified differently threw the counts off, so a topic that had ever been assigned (its blank-`raw` tracking whisper is counted but never movable) would never close on a full merge, was never scheduled for deletion, and — via discourse-topic-voting, which only transfers votes once the source topic closes — left its votes stranded. The same asymmetry ran the other way for ordinary content whispers (dropped from the census by the NULL comparison), so one left behind could wrongly close and delete the source with its content still inside. This change computes `@full_move` directly as "no close-preventing post is left out of the move" — a set difference between the close-preventing posts and the moved posts — using a single NULL-safe predicate (`regular`/`whisper`, `raw <> ''`, `action_code IS DISTINCT FROM 'split_topic'`). Fully merged topics now reliably close and transfer their votes, while a topic still holding whisper content correctly stays open. |
||
|---|---|---|
| .. | ||
| app | ||
| assets | ||
| config | ||
| db | ||
| lib/discourse_topic_voting | ||
| spec | ||
| svg-icons | ||
| test/javascripts | ||
| package.json | ||
| plugin.rb | ||
| README.md | ||
| tsconfig.json | ||
Discourse Topic Voting
Adds the ability for voting on a topic within a specified category.
Topic discussing the plugin itself can be found here: https://meta.discourse.org/t/discourse-voting/40121