Feature #38238
closedAuto watch issues on issue creation
0%
Description
Similar to #4347 we propose adding an option to watch issues the user created. This would allow users to more finely control which issues they want to be notified about rather than having to select the "only owner" or "only my events" and receiving notifications for all the issues the user created. This will also allow in the future to replace the mail notification options with only having auto watching options.
Files
Related issues
Updated by Felix Schäfer almost 2 years ago
- File 38238.patch 38238.patch added
The attached patch adds a new option to auto watch issues the user creates. This option is activated for users that already have the issues contributed to auto watch option active.
Updated by Felix Schäfer almost 2 years ago
Please note there is also a typo in the journal tests:
diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb
index 511b164153..2368f79656 100644
--- a/test/unit/journal_test.rb
+++ b/test/unit/journal_test.rb
@@ -120,7 +120,7 @@ class JournalTest < ActiveSupport::TestCase
end
end
- def test_create_should_add_wacher
+ def test_create_should_add_watcher
user = User.first
user.pref.auto_watch_on=['issue_contributed_to']
user.save
Updated by Go MAEDA almost 2 years ago
- Related to Feature #4347: Contributing to an issue should automatically add the user to the watchers list added
Updated by Felix Schäfer almost 2 years ago
- File 38238-2.patch 38238-2.patch added
We have noticed an issue when this option is activated and the author adds themself as a watcher to the new issue when creating it. This updated patch adds a test for this case and fixes this issue.
Updated by Felix Schäfer almost 2 years ago
I am sorry for the trouble but we have noticed a lot of issues with the callback structure in the proposed patch. We have reworked the feature to use a after_create_commit
callback so that the issue is already saved when the automatic watcher is added and top avoid the issue not getting saved because of errors in the callbacks. Adding automatic watchers is not a core feature of issues and thus should not block creating the issue.
I will post an updated patch shortly.
Updated by Felix Schäfer almost 2 years ago
- File 38238-3_no_anonymous_watcher.patch 38238-3_no_anonymous_watcher.patch added
- File 38238-3.patch 38238-3.patch added
Please see the updated attached patch. As previously summarised this removes adding the automatic watcher from the issue transaction so that this does not interfere with creating the issue.
We have also added a patch to never auto watch for the anonymous user. Due to the anonymous getting new UserPreference
each time the anonymous user is used the default UserPreference
will be used, which includes auto watching new issues and issue edits. This should be fixed with a better UserPreference
for the anonymous user, but this is outside the scope of this issue.
Updated by Go MAEDA almost 2 years ago
- Target version changed from Candidate for next major release to 5.1.0
Setting the target version to 5.1.0.
Updated by Go MAEDA over 1 year ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patches. Thank you for your contribution.
Updated by Go MAEDA over 1 year ago
- Related to Feature #38343: Change the default notification option to "Only for things I watch or I am assigned to" added