Wrong request params to notifications when WebSocket is down
If the WebSocket is down, it'll try to poll on the notifications endpoint, but with invalid parameters:
[info] GET /api/v1/notifications
[debug] QUERY OK source="oauth_tokens" db=12.5ms
(…)
[debug] Processing with Pleroma.Web.MastodonAPI.MastodonAPIController.notifications/2
Parameters: %{"since_id" => "{\"id\":\"52\",\"type\":\"mention\",\"account\":\"231\",\"created_at\":\"2018-12-14T16:53:55.000Z\",\"status\":\"3582\"}"}
Pipelines: [:authenticated_api]
[info] Sent 400 in 40ms
[debug] ** (Ecto.Query.CastError) lib/pleroma/notification.ex:22: value `"{\"id\":\"52\",\"type\":\"mention\",\"account\":\"231\",\"created_at\":\"2018-12-14T16:53:55.000Z\",\"status\":\"3582\"}"` in `where` cannot be cast to type :id in query:
from n in Pleroma.Notification,
where: n.user_id == ^1,
where: n.id > ^"{\"id\":\"52\",\"type\":\"mention\",\"account\":\"231\",\"created_at\":\"2018-12-14T16:53:55.000Z\",\"status\":\"3582\"}",
order_by: [desc: n.id],
limit: 20,
select: n,
preload: [:activity]
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:1418: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1418: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/repo/queryable.ex:124: Ecto.Repo.Queryable.execute/5
(ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
(pleroma) lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:392: Pleroma.Web.MastodonAPI.MastodonAPIController.notifications/2
(pleroma) lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:1: Pleroma.Web.MastodonAPI.MastodonAPIController.action/2
(pleroma) lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:1: Pleroma.Web.MastodonAPI.MastodonAPIController.phoenix_controller_pipeline/2
(pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.instrument/4
(phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1