FIX: chat mailer log noise (#28616)
Fixes the log noise caused by a deprecation notice
This commit is contained in:
parent
0c9c7482b5
commit
54d6e52607
|
@ -398,11 +398,13 @@ module Jobs
|
|||
|
||||
# Simulate the args being dumped/parsed through JSON
|
||||
parsed_opts = JSON.parse(JSON.dump(opts))
|
||||
Discourse.deprecate(<<~TEXT.squish, since: "2.9", drop_from: "3.0") if opts != parsed_opts
|
||||
if opts != parsed_opts
|
||||
Discourse.deprecate(<<~TEXT.squish, since: "2.9", drop_from: "3.0", output_in_test: true)
|
||||
#{klass.name} was enqueued with argument values which do not cleanly serialize to/from JSON.
|
||||
This means that the job will be run with slightly different values than the ones supplied to `enqueue`.
|
||||
Argument values should be strings, booleans, numbers, or nil (or arrays/hashes of those value types).
|
||||
TEXT
|
||||
end
|
||||
opts = parsed_opts
|
||||
|
||||
if ::Jobs.run_later?
|
||||
|
|
|
@ -15,7 +15,7 @@ module Chat
|
|||
if DiscoursePluginRegistry.apply_modifier(:chat_mailer_send_summary_to_user, true, user)
|
||||
Jobs.enqueue(
|
||||
:user_email,
|
||||
type: :chat_summary,
|
||||
type: "chat_summary",
|
||||
user_id: user.id,
|
||||
force_respect_seen_recently: true,
|
||||
)
|
||||
|
|
|
@ -23,7 +23,9 @@ describe Chat::Mailer do
|
|||
end
|
||||
|
||||
def expect_enqueued
|
||||
expect_enqueued_with(job:, args:) { described_class.send_unread_mentions_summary }
|
||||
expect {
|
||||
expect_enqueued_with(job:, args:) { described_class.send_unread_mentions_summary }
|
||||
}.to_not output.to_stderr_from_any_process
|
||||
expect(Jobs::UserEmail.jobs.size).to eq(1)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue