https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-06-12T08:32:03ZRedmineRedmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=172942010-06-12T08:32:03Zde ewr
<ul><li><strong>Assignee</strong> set to <i>Jean-Baptiste Barth</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=174192010-06-18T21:56:42ZHolger Just
<ul><li><strong>Assignee</strong> deleted (<del><i>Jean-Baptiste Barth</i></del>)</li><li><strong>% Done</strong> changed from <i>10</i> to <i>0</i></li></ul><p>This is a general issue with acts_as_watchable.</p>
<p>Watchers are not updated on</p>
<ul>
<li>issue move</li>
<li>issue delete</li>
</ul> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=182182010-07-11T17:28:34ZJean-Baptiste Barth
<ul><li><strong>Subject</strong> changed from <i>database garbage</i> to <i>Watchers not cleaned/updated when deleting/moving watched object</i></li><li><strong>Affected version (unused)</strong> changed from <i>0.9.3</i> to <i>devel</i></li><li><strong>Affected version</strong> deleted (<del><i>0.9.3</i></del>)</li></ul> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=973972020-04-20T14:57:27ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Tested on the current trunk and watchers are deleted when an issue is deleted.</p>
<p>Before:<br /><pre>
D, [2020-04-20T14:49:48.968211 #66] DEBUG -- : Watcher Load (0.7ms) SELECT `watchers`.* FROM `watchers` LIMIT 11
=> #<ActiveRecord::Relation [#<Watcher id: 362429562, watchable_type: "Issue", watchable_id: 2, user_id: 1>, #<Watcher id: 580717795, watchable_type: "Message", watchable_id: 1, user_id: 1>, #<Watcher id: 999578971, watchable_type: "Issue", watchable_id: 2, user_id: 3>, #<Watcher id: 999578972, watchable_type: "Issue", watchable_id: 4, user_id: 4>, #<Watcher id: 999578973, watchable_type: "Issue", watchable_id: 2, user_id: 4>]>
irb(main):002:0> Watcher.all
</pre></p>
<p>After I've deleted Issue#4<br /><pre>
D, [2020-04-20T14:50:13.301428 #66] DEBUG -- : Watcher Load (0.7ms) SELECT `watchers`.* FROM `watchers` LIMIT 11
=> #<ActiveRecord::Relation [#<Watcher id: 362429562, watchable_type: "Issue", watchable_id: 2, user_id: 1>, #<Watcher id: 580717795, watchable_type: "Message", watchable_id: 1, user_id: 1>, #<Watcher id: 999578971, watchable_type: "Issue", watchable_id: 2, user_id: 3>, #<Watcher id: 999578973, watchable_type: "Issue", watchable_id: 2, user_id: 4>]>
</pre></p>
<p>For issue move, the watcher should not be deleted automatically, but there is a new issue to mark them as invalid (when the watcher watches a non visible object, please see <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Improve watchers functionality to mark the users that are watching a non visible object and to no... (Closed)" href="https://www.redmine.org/issues/33329">#33329</a>).</p> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=973992020-04-20T14:57:44ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/33329">Patch #33329</a>: Improve watchers functionality to mark the users that are watching a non visible object and to not return watchers that cannot see the object</i> added</li></ul> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=974012020-04-20T16:09:06ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/7296">Feature #7296</a>: Ability for admin to delete users</i> added</li></ul> Redmine - Defect #5679: Watchers not cleaned/updated when deleting/moving watched objecthttps://www.redmine.org/issues/5679?journal_id=974032020-04-20T16:09:20ZMarius BĂLTEANU
<ul></ul><p>Removing watchers on issue delete was fixed in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Ability for admin to delete users (Closed)" href="https://www.redmine.org/issues/7296">#7296</a>.</p>