Project

General

Profile

Actions

Defect #5679

closed

Watchers not cleaned/updated when deleting/moving watched object

Added by Alexey Kiryanov almost 14 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
2010-06-12
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I have found field in the 'watchers' table to the non-existing forum post (it was deleted with a project).

Postgresql 8.1
ruby 1.8.7
Rails 2.3.5


Related issues

Related to Redmine - Patch #33329: Improve watchers functionality to mark the users that are watching a non visible object and to not return watchers that cannot see the objectClosedGo MAEDA

Actions
Related to Redmine - Feature #7296: Ability for admin to delete usersClosed2011-01-11

Actions
Actions #1

Updated by de ewr almost 14 years ago

  • Assignee set to Jean-Baptiste Barth
  • % Done changed from 0 to 10
Actions #2

Updated by Holger Just almost 14 years ago

  • Assignee deleted (Jean-Baptiste Barth)
  • % Done changed from 10 to 0

This is a general issue with acts_as_watchable.

Watchers are not updated on

  • issue move
  • issue delete
Actions #3

Updated by Jean-Baptiste Barth over 13 years ago

  • Subject changed from database garbage to Watchers not cleaned/updated when deleting/moving watched object
  • Affected version (unused) changed from 0.9.3 to devel
  • Affected version deleted (0.9.3)
Actions #4

Updated by Marius BĂLTEANU almost 4 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Tested on the current trunk and watchers are deleted when an issue is deleted.

Before:

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

After I've deleted Issue#4

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>]>

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 #33329).

Actions #5

Updated by Marius BĂLTEANU almost 4 years ago

  • Related to Patch #33329: Improve watchers functionality to mark the users that are watching a non visible object and to not return watchers that cannot see the object added
Actions #6

Updated by Marius BĂLTEANU almost 4 years ago

  • Related to Feature #7296: Ability for admin to delete users added
Actions #7

Updated by Marius BĂLTEANU almost 4 years ago

Removing watchers on issue delete was fixed in #7296.

Actions

Also available in: Atom PDF