mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 04:52:17 +00:00
Fix WebPush notifications not generating jobs
Dialyzer pointed this one out. The WorkerHelper removal in !4166 was missing this Oban.insert() and tests were not noticing any problems because we mocked the Push.send function instead of executing it and checking for the Oban job.
This commit is contained in:
parent
351a306d46
commit
721005b312
2 changed files with 6 additions and 8 deletions
|
@ -29,5 +29,6 @@ defmodule Pleroma.Web.Push do
|
|||
{:ok, Oban.Job.t()} | {:error, Oban.Job.changeset() | term()}
|
||||
def send(notification) do
|
||||
WebPusherWorker.new(%{"op" => "web_push", "notification_id" => notification.id})
|
||||
|> Oban.insert()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,20 +54,17 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
|
|||
[
|
||||
stream: fn _, _ -> nil end
|
||||
]
|
||||
},
|
||||
{
|
||||
Pleroma.Web.Push,
|
||||
[],
|
||||
[
|
||||
send: fn _ -> nil end
|
||||
]
|
||||
}
|
||||
]) do
|
||||
SideEffects.handle_after_transaction(meta)
|
||||
|
||||
assert called(Pleroma.Web.Streamer.stream(["user", "user:notification"], notification))
|
||||
assert called(Pleroma.Web.Streamer.stream(["user", "user:pleroma_chat"], :_))
|
||||
assert called(Pleroma.Web.Push.send(notification))
|
||||
|
||||
assert_enqueued(
|
||||
worker: "Pleroma.Workers.WebPusherWorker",
|
||||
args: %{"notification_id" => notification.id, "op" => "web_push"}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue