Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
acd139d9
Commit
acd139d9
authored
Mar 16, 2021
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cast object class to string to avoid infinite loop
parent
e095507c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
6 deletions
+6
-6
app/services/notification_service.rb
app/services/notification_service.rb
+1
-1
ee/spec/services/ee/notification_service_spec.rb
ee/spec/services/ee/notification_service_spec.rb
+1
-1
ee/spec/workers/new_epic_worker_spec.rb
ee/spec/workers/new_epic_worker_spec.rb
+1
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+1
-1
spec/workers/new_issue_worker_spec.rb
spec/workers/new_issue_worker_spec.rb
+1
-1
spec/workers/new_merge_request_worker_spec.rb
spec/workers/new_merge_request_worker_spec.rb
+1
-1
No files found.
app/services/notification_service.rb
View file @
acd139d9
...
...
@@ -857,7 +857,7 @@ class NotificationService
end
def
warn_skipping_notifications
(
user
,
object
)
Gitlab
::
AppLogger
.
warn
(
message:
"Skipping sending notifications"
,
user:
user
.
id
,
klass:
object
.
class
,
object_id:
object
.
id
)
Gitlab
::
AppLogger
.
warn
(
message:
"Skipping sending notifications"
,
user:
user
.
id
,
klass:
object
.
class
.
to_s
,
object_id:
object
.
id
)
end
end
...
...
ee/spec/services/ee/notification_service_spec.rb
View file @
acd139d9
...
...
@@ -655,7 +655,7 @@ RSpec.describe EE::NotificationService, :mailer do
shared_examples
'is not able to send notifications'
do
it
'does not send any notification'
do
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
current_user
.
id
,
klass:
epic
.
class
,
object_id:
epic
.
id
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
current_user
.
id
,
klass:
epic
.
class
.
to_s
,
object_id:
epic
.
id
)
execute
...
...
ee/spec/workers/new_epic_worker_spec.rb
View file @
acd139d9
...
...
@@ -45,7 +45,7 @@ RSpec.describe NewEpicWorker do
it
'does not create a notification for the mentioned user'
do
expect
(
Notify
).
not_to
receive
(
:new_epic_email
).
with
(
user
.
id
,
epic
.
id
,
nil
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
epic
.
class
,
object_id:
epic
.
id
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
epic
.
class
.
to_s
,
object_id:
epic
.
id
)
worker
.
perform
(
epic
.
id
,
user
.
id
)
end
...
...
spec/services/notification_service_spec.rb
View file @
acd139d9
...
...
@@ -105,7 +105,7 @@ RSpec.describe NotificationService, :mailer do
recipient_1
=
NotificationRecipient
.
new
(
user_1
,
:custom
,
custom_action: :new_release
)
allow
(
NotificationRecipients
::
BuildService
).
to
receive
(
:build_new_release_recipients
).
and_return
([
recipient_1
])
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
current_user
.
id
,
klass:
object
.
class
,
object_id:
object
.
id
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
current_user
.
id
,
klass:
object
.
class
.
to_s
,
object_id:
object
.
id
)
action
...
...
spec/workers/new_issue_worker_spec.rb
View file @
acd139d9
...
...
@@ -49,7 +49,7 @@ RSpec.describe NewIssueWorker do
expect
(
Notify
).
not_to
receive
(
:new_issue_email
)
.
with
(
mentioned
.
id
,
issue
.
id
,
NotificationReason
::
MENTIONED
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
issue
.
class
,
object_id:
issue
.
id
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
issue
.
class
.
to_s
,
object_id:
issue
.
id
)
worker
.
perform
(
issue
.
id
,
user
.
id
)
end
...
...
spec/workers/new_merge_request_worker_spec.rb
View file @
acd139d9
...
...
@@ -53,7 +53,7 @@ RSpec.describe NewMergeRequestWorker do
expect
(
Notify
).
not_to
receive
(
:new_merge_request_email
)
.
with
(
mentioned
.
id
,
merge_request
.
id
,
NotificationReason
::
MENTIONED
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
merge_request
.
class
,
object_id:
merge_request
.
id
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:warn
).
with
(
message:
'Skipping sending notifications'
,
user:
user
.
id
,
klass:
merge_request
.
class
.
to_s
,
object_id:
merge_request
.
id
)
worker
.
perform
(
merge_request
.
id
,
user
.
id
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment