Commit graph

6897 commits

Author SHA1 Message Date
Mark Felder 90c9f38f40 Pleroma.Web.MastodonAPI.MediaController: fix dialyzer errors with replace_params: false 2024-01-30 18:09:11 -05:00
Mark Felder 9741f045e4 Pleroma.Web.MastodonAPI.ListController: fix dialyzer errors with replace_params: false 2024-01-30 18:05:28 -05:00
Mark Felder 14de8376ad Pleroma.Web.MastodonAPI.FollowRequestController: fix dialyzer errors with replace_params: false 2024-01-30 17:56:43 -05:00
Mark Felder f400224a00 Pleroma.Web.AdminAPI.UserController: fix dialyzer errors with replace_params: false 2024-01-30 17:51:40 -05:00
Mark Felder dd916e0b4c Pleroma.Web.AdminAPI.ReportController: fix dialyzer errors with replace_params: false 2024-01-30 17:24:26 -05:00
Mark Felder b84a33a101 Pleroma.Web.AdminAPI.RelayController: fix dialyzer errors with replace_params: false 2024-01-30 17:13:14 -05:00
Mark Felder fb6f53fc12 Pleroma.Web.AdminAPI.MediaProxyCacheController: fix dialyzer errors with replace_params: false 2024-01-30 17:11:43 -05:00
Mark Felder ea26dcd800 Pleroma.Web.AdminAPI.InviteController: fix dialyzer errors with replace_params: false 2024-01-30 17:06:37 -05:00
Mark Felder 85c9397ec7 Pleroma.Web.AdminAPI.InstanceDocumentController: fix dialyzer errors with replace_params: false 2024-01-30 17:04:12 -05:00
Mark Felder ef1f301756 Pleroma.Web.AdminAPI.ConfigController: fix dialyzer errors with replace_params: false 2024-01-30 16:59:28 -05:00
Mark Felder 81c8592d69 Pleroma.Web.MastodonAPI.AccountController: fix dialyzer errors with replace_params: false 2024-01-30 16:50:00 -05:00
Mark Felder cfe7438b2f Pleroma.Web.MastodonAPI.DomainBlockController: dialyzer fixes via :replace_params 2024-01-30 14:52:15 -05:00
Mark Felder 608466d098 Modify our CastAndValidate plug to include the new functionality provided by the :replace_params config option
This allows us to configure Open API Spex to not overwrite the params with the casted versions which violates the Plug.Conn.t() contract

https://github.com/open-api-spex/open_api_spex/issues/92
https://github.com/open-api-spex/open_api_spex/pull/425
2024-01-30 14:49:55 -05:00
Mark Felder 8476eb1842 Revert "Pleroma.Web.AdminAPI.MediaProxyCacheController: dialyzer errors"
This reverts commit 8b02c85810.
2024-01-30 14:20:02 -05:00
Mark Felder 88a35b2865 Revert "Pleroma.Web.TwitterAPI.UtilController: dialyzer fixes"
This reverts commit 17f4251b19.
2024-01-30 14:19:54 -05:00
Mark Felder 674ae51d6a Revert "Pleroma.Web.PleromaAPI.UserImportController: Dialyzer errors"
This reverts commit 52e18a6249.
2024-01-30 14:19:41 -05:00
Mark Felder 4a80a285d1 Revert "Pleroma.Web.PleromaAPI.NotificationController: dialyzer errors"
This reverts commit 26a95e5787.
2024-01-30 14:19:32 -05:00
Mark Felder 1e76ceacd5 Revert "Pleroma.Web.AdminAPI.ConfigController: dialyzer error"
This reverts commit 60d89cb404.
2024-01-30 14:19:13 -05:00
Mark Felder 2c8e4f32c6 Revert "Pleroma.Web.PleromaAPI.MascotController: dialyzer errors"
This reverts commit 9c8055d4b3.
2024-01-30 14:18:36 -05:00
Mark Felder b1a6102a85 Revert "Pleroma.Web.PleromaAPI.EmojiPackController: dialyzer errors"
This reverts commit 77bf617c4b.
2024-01-30 14:15:40 -05:00
Mark Felder 4a9ed4682a Revert "Pleroma.Web.PleromaAPI.EmojiFileController: dialyzer errors"
This reverts commit dc912dc590.
2024-01-30 14:15:17 -05:00
Mark Felder b709fc4dfe Revert "Pleroma.Web.PleromaAPI.ChatController: Dialyzer error"
This reverts commit 8d64eedbec.
2024-01-30 14:15:05 -05:00
Mark Felder 589456f0ba Revert "Pleroma.Web.AdminAPI.InviteController: dialyzer errors"
This reverts commit db87be126e.
2024-01-30 14:14:56 -05:00
Mark Felder 4227db0871 Revert "Pleroma.Web.AdminAPI.UserController: dialyzer errors"
This reverts commit d92c3d927d.
2024-01-30 14:14:39 -05:00
Mark Felder ac06a47689 Revert "Pleroma.Web.AdminAPI.RelayController: dialyzer errors"
This reverts commit 94838ed941.
2024-01-30 14:14:22 -05:00
Mark Felder da5e0fca4f Revert "Pleroma.Web.AdminAPI.ReportController: dialyzer errors"
This reverts commit bfe626d578.
2024-01-30 14:14:07 -05:00
Mark Felder 39241107d9 Revert "Pleroma.Web.AdminAPI.InstanceDocumentController: fix dialyzer error"
This reverts commit a3024dd5ac.
2024-01-30 14:13:56 -05:00
Mark Felder 1fa1a93cd6 Revert "Pleroma.Web.MastodonAPI.AccountController: dialyzer errors"
This reverts commit e53c20b03c.
2024-01-30 14:13:46 -05:00
Mark Felder 41493bd642 Revert "Pleroma.Web.MastodonAPI.DomainBlockController: dialyzer errors"
This reverts commit 378edeaf15.
2024-01-30 14:13:23 -05:00
Mark Felder a3426fcaf3 Revert "Pleroma.Web.MastodonAPI.MediaController: dialyzer errors"
This reverts commit 8cd5279857.
2024-01-30 14:13:13 -05:00
Mark Felder b666710574 Pleroma.Web.MediaProxy.MediaProxyController: dialyzer errors
lib/pleroma/web/media_proxy/media_proxy_controller.ex:55:no_return
Function handle_preview/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:59:call
The function call will not succeed.

Pleroma.HTTP.request(<<72, 69, 65, 68>>, _media_proxy_url :: any(), [], [], [{:pool, :media}])

will never return since the success typing is:
(
  :delete | :get | :head | :options | :patch | :post | :put | :trace,
  binary(),
  any(),
  [{binary(), binary()}],
  Keyword.t()
) :: any()

and the contract is
(
  method(),
  Pleroma.HTTP.Request.url(),
  String.t(),
  Pleroma.HTTP.Request.headers(),
  :elixir.keyword()
) :: {:ok, Tesla.Env.t()} | {:error, any()}

________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:95:unused_fun
Function handle_preview/3 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:111:unused_fun
Function handle_png_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:134:unused_fun
Function handle_jpeg_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:152:unused_fun
Function handle_video_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:164:unused_fun
Function drop_static_param_and_redirect/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:173:unused_fun
Function fallback_on_preview_error/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun
Function put_preview_response_headers/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun
Function put_preview_response_headers/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:187:unused_fun
Function thumbnail_max_dimensions/0 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:196:unused_fun
Function min_content_length_for_preview/0 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:200:unused_fun
Function media_preview_proxy_config/0 will never be called.
2024-01-29 18:50:50 -05:00
Mark Felder 8cd5279857 Pleroma.Web.MastodonAPI.MediaController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/media_controller.ex:32:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:file => _, _ => _},
    _ => _
  },
  <<97, 116, 116, 97, 99, 104, 109, 101, 110, 116, 46, 106, 115, 111, 110>>,
  %{:attachment => map()}
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/media_controller.ex:48:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:file => _, _ => _},
    _ => _
  },
  202
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/media_controller.ex:63:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:description => _, _ => _},
    _ => _
  },
  <<97, 116, 116, 97, 99, 104, 109, 101, 110, 116, 46, 106, 115, 111, 110>>,
  %{:attachment => map()}
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()
2024-01-29 18:36:46 -05:00
Mark Felder 378edeaf15 Pleroma.Web.MastodonAPI.DomainBlockController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex:32:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:domain => _, _ => _},
    _ => _
  },
  %{}
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex:43:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:domain => _, _ => _},
    _ => _
  },
  %{}
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-29 18:36:34 -05:00
Mark Felder 3cb2807244 Pleroma.Web.MastodonAPI.StatusView: dialyzer error
lib/pleroma/web/mastodon_api/views/status_view.ex:799:pattern_match_cov
The pattern
_, _

can never match, because previous clauses completely cover the type

  %URI{
    :authority => URI.authority(),
    :fragment => nil | binary(),
    :host => nil | binary(),
    :path => nil | binary(),
    :port => nil | char(),
    :query => nil | binary(),
    :scheme => nil | binary(),
    :userinfo => nil | binary()
  },
  %URI{
    :authority => URI.authority(),
    :fragment => nil | binary(),
    :host => nil | binary(),
    :path => nil | binary(),
    :port => nil | char(),
    :query => nil | binary(),
    :scheme => nil | binary(),
    :userinfo => nil | binary()
  }
.
2024-01-29 18:28:49 -05:00
Mark Felder 2de84e2e3b API Specs: many dialyzer errors
Too many to include in a commit log

Module instead of schema was being passed
2024-01-29 17:10:28 -05:00
Mark Felder 4fc177eb46 Pleroma.Web.ControllerHelper: dialyzer error
lib/pleroma/web/controller_helper.ex:97:pattern_match
The pattern can never match the type.

Pattern:
nil

Type:
%Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{
    binary() =>
      binary()
      | [binary() | [any()] | %{binary() => _}]
      | %{binary() => binary() | [any()] | %{binary() => _}}
  },
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() =>
      binary()
      | [binary() | [any()] | %{binary() => _}]
      | %{binary() => binary() | [any()] | %{binary() => _}}
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{binary(), binary()}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{binary(), binary()}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}
2024-01-29 16:42:48 -05:00
Haelwenn 251c455b91 Merge branch 'deps-bump' into 'develop'
Bump dependencies

See merge request pleroma/pleroma!4044
2024-01-29 17:43:00 +00:00
Mark Felder 6a22a80f9f Pleroma.Web.MastodonAPI.DirectoryController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_auth/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_plug/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:18:guard_fail
The guard clause:

when _action :: atom() == <<105, 110, 100, 101, 120>>

can never succeed.
2024-01-28 17:41:07 -05:00
Mark Felder e53c20b03c Pleroma.Web.MastodonAPI.AccountController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/account_controller.ex:479:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:account => _, :user => _, _ => _},
    :body_params => %{:comment => _, _ => _},
    _ => _
  },
  <<114, 101, 108, 97, 116, 105, 111, 110, 115, 104, 105, 112, 46, 106, 115, 111, 110>>,
  [
    {:target, %Pleroma.User{:id => _, _ => _}} | {:user, %Pleroma.User{:id => _, _ => _}},
    ...
  ]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/account_controller.ex:519:call
The function call will not succeed.

Plug.Conn.assign(
  _conn :: %{:body_params => %{:uri => _, _ => _}, _ => _},
  :account,
  _user :: %Pleroma.User{_ => _}
)

breaks the contract
(t(), atom(), term()) :: t()
2024-01-28 17:41:07 -05:00
Mark Felder e2fc03ec72 Pleroma.Web.ActivityPub.Utils: dialyzer error
lib/pleroma/web/activity_pub/utils.ex:779:guard_fail
The guard clause:

when _ :: %Pleroma.Object{_ => _} === nil

can never succeed.
2024-01-28 17:14:41 -05:00
Mark Felder 082d665160 Pleroma.Web.AdminAPI.UserController: dialyzer errors
lib/pleroma/web/admin_api/controllers/user_controller.ex:205:no_return
Function activate/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:215:call
The function call will not succeed.

Keyword.values(
  _updated_users :: %Pleroma.User{
    :__meta__ => _,
    :accepts_chat_messages => _,
    :actor_type => _,
    :allow_following_move => _,
    :also_known_as => _,
    :ap_id => _,
    :avatar => _,
    :background => _,
    :banner => _,
    :bio => _,
    :birthday => _,
    :blocked_users => _,
    :blockee_blocks => _,
    :blocker_blocks => _,
    :blocker_users => _,
    :blocks => _,
    :confirmation_token => _,
    :default_scope => _,
    :deliveries => _,
    :disclose_client => _,
    :domain_blocks => _,
    :email => _,
    :email_notifications => _,
    :emoji => _,
    :endorsed_users => _,
    :endorsee_endorsements => _,
    :endorser_endorsements => _,
    :endorser_users => _,
    :featured_address => _,
    :fields => _,
    :follower_address => _,
    :follower_count => _,
    :following_address => _,
    :following_count => _,
    :hide_favorites => _,
    :hide_followers => _,
    :hide_followers_count => _,
    :hide_follows => _,
    :hide_follows_count => _,
    :id => _,
    :inbox => _,
    :incoming_relationships => _,
    :inserted_at => _,
    :invisible => _,
    :is_active => _,
    :is_admin => _,
    :is_approved => _,
    :is_confirmed => _,
    :is_discoverable => _,
    :is_locked => _,
    :is_moderator => _,
    :is_suggested => _,
    :keys => _,
    :language => _,
    :last_active_at => _,
    :last_digest_emailed_at => _,
    :last_refreshed_at => _,
    :last_status_at => _,
    :local => _,
    :mascot => _,
    :multi_factor_authentication_settings => _,
    :muted_notifications => _,
    :muted_reblogs => _,
    :muted_users => _,
    :mutee_mutes => _,
    :muter_mutes => _,
    :muter_users => _,
    :mutes => _,
    :name => _,
    :nickname => _,
    :no_rich_text => _,
    :note_count => _,
    :notification_muted_users => _,
    :notification_mutee_mutes => _,
    :notification_muter_mutes => _,
    :notification_muter_users => _,
    :notification_settings => _,
    :notifications => _,
    :outgoing_relationships => _,
    :password => _,
    :password_confirmation => _,
    :password_hash => _,
    :password_reset_pending => _,
    :pinned_objects => _,
    :pleroma_settings_store => _,
    :public_key => _,
    :raw_bio => _,
    :raw_fields => _,
    :reblog_muted_users => _,
    :reblog_mutee_mutes => _,
    :reblog_muter_mutes => _,
    :reblog_muter_users => _,
    :registration_reason => _,
    :registrations => _,
    :search_rank => _,
    :search_type => _,
    :shared_inbox => _,
    :show_birthday => _,
    :show_role => _,
    :skip_thread_containment => _,
    :subscribee_subscriptions => _,
    :subscribee_users => _,
    :subscriber_subscriptions => _,
    :subscriber_users => _,
    :subscribers => _,
    :tags => _,
    :updated_at => _,
    :uri => _
  }
)

will never return since the success typing is:
([any()]) :: [any()]

and the contract is
(t()) :: [value()]

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:218:no_return
Function deactivate/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:228:call
The function call will not succeed.

Keyword.values(
  _updated_users :: %Pleroma.User{
    :__meta__ => _,
    :accepts_chat_messages => _,
    :actor_type => _,
    :allow_following_move => _,
    :also_known_as => _,
    :ap_id => _,
    :avatar => _,
    :background => _,
    :banner => _,
    :bio => _,
    :birthday => _,
    :blocked_users => _,
    :blockee_blocks => _,
    :blocker_blocks => _,
    :blocker_users => _,
    :blocks => _,
    :confirmation_token => _,
    :default_scope => _,
    :deliveries => _,
    :disclose_client => _,
    :domain_blocks => _,
    :email => _,
    :email_notifications => _,
    :emoji => _,
    :endorsed_users => _,
    :endorsee_endorsements => _,
    :endorser_endorsements => _,
    :endorser_users => _,
    :featured_address => _,
    :fields => _,
    :follower_address => _,
    :follower_count => _,
    :following_address => _,
    :following_count => _,
    :hide_favorites => _,
    :hide_followers => _,
    :hide_followers_count => _,
    :hide_follows => _,
    :hide_follows_count => _,
    :id => _,
    :inbox => _,
    :incoming_relationships => _,
    :inserted_at => _,
    :invisible => _,
    :is_active => _,
    :is_admin => _,
    :is_approved => _,
    :is_confirmed => _,
    :is_discoverable => _,
    :is_locked => _,
    :is_moderator => _,
    :is_suggested => _,
    :keys => _,
    :language => _,
    :last_active_at => _,
    :last_digest_emailed_at => _,
    :last_refreshed_at => _,
    :last_status_at => _,
    :local => _,
    :mascot => _,
    :multi_factor_authentication_settings => _,
    :muted_notifications => _,
    :muted_reblogs => _,
    :muted_users => _,
    :mutee_mutes => _,
    :muter_mutes => _,
    :muter_users => _,
    :mutes => _,
    :name => _,
    :nickname => _,
    :no_rich_text => _,
    :note_count => _,
    :notification_muted_users => _,
    :notification_mutee_mutes => _,
    :notification_muter_mutes => _,
    :notification_muter_users => _,
    :notification_settings => _,
    :notifications => _,
    :outgoing_relationships => _,
    :password => _,
    :password_confirmation => _,
    :password_hash => _,
    :password_reset_pending => _,
    :pinned_objects => _,
    :pleroma_settings_store => _,
    :public_key => _,
    :raw_bio => _,
    :raw_fields => _,
    :reblog_muted_users => _,
    :reblog_mutee_mutes => _,
    :reblog_muter_mutes => _,
    :reblog_muter_users => _,
    :registration_reason => _,
    :registrations => _,
    :search_rank => _,
    :search_type => _,
    :shared_inbox => _,
    :show_birthday => _,
    :show_role => _,
    :skip_thread_containment => _,
    :subscribee_subscriptions => _,
    :subscribee_users => _,
    :subscriber_subscriptions => _,
    :subscriber_users => _,
    :subscribers => _,
    :tags => _,
    :updated_at => _,
    :uri => _
  }
)

will never return since the success typing is:
([any()]) :: [any()]

and the contract is
(t()) :: [value()]
2024-01-28 17:14:37 -05:00
Mark Felder a3024dd5ac Pleroma.Web.AdminAPI.InstanceDocumentController: fix dialyzer error
lib/pleroma/web/admin_api/controllers/instance_document_controller.ex:32:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:file => _, _ => _}, _ => _}, %{<<_::24>> => binary()}) ::
  :ok
def a() do
  :ok
end

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-28 16:35:30 -05:00
Mark Felder bfe626d578 Pleroma.Web.AdminAPI.ReportController: dialyzer errors
lib/pleroma/web/admin_api/controllers/report_controller.ex:48:no_return
Function update/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/report_controller.ex:70:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.json_response(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:reports => _, _ => _},
    _ => _
  },
  :bad_request,
  _result :: [any()]
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | 1..1_114_111,
  any()
)

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/report_controller.ex:72:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.json_response(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:reports => _, _ => _},
    _ => _
  },
  :no_content,
  <<>>
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | 1..1_114_111,
  any()
)

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/report_controller.ex:76:no_return
Function notes_create/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/report_controller.ex:89:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.json_response(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:content => _, _ => _},
    _ => _
  },
  :no_content,
  <<>>
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | 1..1_114_111,
  any()
)

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/report_controller.ex:91:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.json_response(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:content => _, _ => _},
    _ => _
  },
  :bad_request,
  <<>>
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | 1..1_114_111,
  any()
)
2024-01-28 16:32:50 -05:00
Mark Felder 94838ed941 Pleroma.Web.AdminAPI.RelayController: dialyzer errors
lib/pleroma/web/admin_api/controllers/relay_controller.ex:34:no_return
Function follow/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/relay_controller.ex:38:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:relay_url => _, _ => _},
    _ => _
  },
  %{:actor => binary(), :followed_back => boolean()}
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/relay_controller.ex:41:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:relay_url => _, _ => _},
    _ => _
  },
  500
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/relay_controller.ex:47:no_return
Function unfollow/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/relay_controller.ex:51:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:relay_url => _, _ => _},
    _ => _
  },
  _target :: binary()
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/relay_controller.ex:54:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:relay_url => _, _ => _},
    _ => _
  },
  500
)

breaks the contract
(t(), status()) :: t()
2024-01-28 16:09:55 -05:00
Mark Felder d92c3d927d Pleroma.Web.AdminAPI.UserController: dialyzer errors
lib/pleroma/web/admin_api/controllers/user_controller.ex:54:no_return
Function delete/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:74:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:nicknames => _, _ => _},
    _ => _
  },
  _nicknames :: any()
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:77:no_return
Function follow/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:99:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:followed => _, :follower => _, _ => _},
    _ => _
  },
  <<111, 107>>
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:102:no_return
Function unfollow/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:124:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:followed => _, :follower => _, _ => _},
    _ => _
  },
  <<111, 107>>
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:127:no_return
Function create/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:130:no_return
The created anonymous function has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:163:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:users => _, _ => _},
    _ => _
  },
  <<99, 114, 101, 97, 116, 101, 100, 95, 109, 97, 110, 121, 46, 106, 115, 111, 110>>,
  [{:users, [any()]}, ...]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:175:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:users => _, _ => _},
    _ => _
  },
  :conflict
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:205:no_return
Function activate/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:215:call
The function call will not succeed.

Keyword.values(
  _updated_users :: %Pleroma.User{
    :__meta__ => _,
    :accepts_chat_messages => _,
    :actor_type => _,
    :allow_following_move => _,
    :also_known_as => _,
    :ap_id => _,
    :avatar => _,
    :background => _,
    :banner => _,
    :bio => _,
    :birthday => _,
    :blocked_users => _,
    :blockee_blocks => _,
    :blocker_blocks => _,
    :blocker_users => _,
    :blocks => _,
    :confirmation_token => _,
    :default_scope => _,
    :deliveries => _,
    :disclose_client => _,
    :domain_blocks => _,
    :email => _,
    :email_notifications => _,
    :emoji => _,
    :endorsed_users => _,
    :endorsee_endorsements => _,
    :endorser_endorsements => _,
    :endorser_users => _,
    :featured_address => _,
    :fields => _,
    :follower_address => _,
    :follower_count => _,
    :following_address => _,
    :following_count => _,
    :hide_favorites => _,
    :hide_followers => _,
    :hide_followers_count => _,
    :hide_follows => _,
    :hide_follows_count => _,
    :id => _,
    :inbox => _,
    :incoming_relationships => _,
    :inserted_at => _,
    :invisible => _,
    :is_active => _,
    :is_admin => _,
    :is_approved => _,
    :is_confirmed => _,
    :is_discoverable => _,
    :is_locked => _,
    :is_moderator => _,
    :is_suggested => _,
    :keys => _,
    :language => _,
    :last_active_at => _,
    :last_digest_emailed_at => _,
    :last_refreshed_at => _,
    :last_status_at => _,
    :local => _,
    :mascot => _,
    :multi_factor_authentication_settings => _,
    :muted_notifications => _,
    :muted_reblogs => _,
    :muted_users => _,
    :mutee_mutes => _,
    :muter_mutes => _,
    :muter_users => _,
    :mutes => _,
    :name => _,
    :nickname => _,
    :no_rich_text => _,
    :note_count => _,
    :notification_muted_users => _,
    :notification_mutee_mutes => _,
    :notification_muter_mutes => _,
    :notification_muter_users => _,
    :notification_settings => _,
    :notifications => _,
    :outgoing_relationships => _,
    :password => _,
    :password_confirmation => _,
    :password_hash => _,
    :password_reset_pending => _,
    :pinned_objects => _,
    :pleroma_settings_store => _,
    :public_key => _,
    :raw_bio => _,
    :raw_fields => _,
    :reblog_muted_users => _,
    :reblog_mutee_mutes => _,
    :reblog_muter_mutes => _,
    :reblog_muter_users => _,
    :registration_reason => _,
    :registrations => _,
    :search_rank => _,
    :search_type => _,
    :shared_inbox => _,
    :show_birthday => _,
    :show_role => _,
    :skip_thread_containment => _,
    :subscribee_subscriptions => _,
    :subscribee_users => _,
    :subscriber_subscriptions => _,
    :subscriber_users => _,
    :subscribers => _,
    :tags => _,
    :updated_at => _,
    :uri => _
  }
)

will never return since the success typing is:
([any()]) :: [any()]

and the contract is
(t()) :: [value()]

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:218:no_return
Function deactivate/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:228:call
The function call will not succeed.

Keyword.values(
  _updated_users :: %Pleroma.User{
    :__meta__ => _,
    :accepts_chat_messages => _,
    :actor_type => _,
    :allow_following_move => _,
    :also_known_as => _,
    :ap_id => _,
    :avatar => _,
    :background => _,
    :banner => _,
    :bio => _,
    :birthday => _,
    :blocked_users => _,
    :blockee_blocks => _,
    :blocker_blocks => _,
    :blocker_users => _,
    :blocks => _,
    :confirmation_token => _,
    :default_scope => _,
    :deliveries => _,
    :disclose_client => _,
    :domain_blocks => _,
    :email => _,
    :email_notifications => _,
    :emoji => _,
    :endorsed_users => _,
    :endorsee_endorsements => _,
    :endorser_endorsements => _,
    :endorser_users => _,
    :featured_address => _,
    :fields => _,
    :follower_address => _,
    :follower_count => _,
    :following_address => _,
    :following_count => _,
    :hide_favorites => _,
    :hide_followers => _,
    :hide_followers_count => _,
    :hide_follows => _,
    :hide_follows_count => _,
    :id => _,
    :inbox => _,
    :incoming_relationships => _,
    :inserted_at => _,
    :invisible => _,
    :is_active => _,
    :is_admin => _,
    :is_approved => _,
    :is_confirmed => _,
    :is_discoverable => _,
    :is_locked => _,
    :is_moderator => _,
    :is_suggested => _,
    :keys => _,
    :language => _,
    :last_active_at => _,
    :last_digest_emailed_at => _,
    :last_refreshed_at => _,
    :last_status_at => _,
    :local => _,
    :mascot => _,
    :multi_factor_authentication_settings => _,
    :muted_notifications => _,
    :muted_reblogs => _,
    :muted_users => _,
    :mutee_mutes => _,
    :muter_mutes => _,
    :muter_users => _,
    :mutes => _,
    :name => _,
    :nickname => _,
    :no_rich_text => _,
    :note_count => _,
    :notification_muted_users => _,
    :notification_mutee_mutes => _,
    :notification_muter_mutes => _,
    :notification_muter_users => _,
    :notification_settings => _,
    :notifications => _,
    :outgoing_relationships => _,
    :password => _,
    :password_confirmation => _,
    :password_hash => _,
    :password_reset_pending => _,
    :pinned_objects => _,
    :pleroma_settings_store => _,
    :public_key => _,
    :raw_bio => _,
    :raw_fields => _,
    :reblog_muted_users => _,
    :reblog_mutee_mutes => _,
    :reblog_muter_mutes => _,
    :reblog_muter_users => _,
    :registration_reason => _,
    :registrations => _,
    :search_rank => _,
    :search_type => _,
    :shared_inbox => _,
    :show_birthday => _,
    :show_role => _,
    :skip_thread_containment => _,
    :subscribee_subscriptions => _,
    :subscribee_users => _,
    :subscriber_subscriptions => _,
    :subscriber_users => _,
    :subscribers => _,
    :tags => _,
    :updated_at => _,
    :uri => _
  }
)

will never return since the success typing is:
([any()]) :: [any()]

and the contract is
(t()) :: [value()]

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:231:no_return
Function approve/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:241:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:nicknames => _, _ => _},
    _ => _
  },
  <<105, 110, 100, 101, 120, 46, 106, 115, 111, 110>>,
  [{:users, _}, ...]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:244:no_return
Function suggest/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:254:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:nicknames => _, _ => _},
    _ => _
  },
  <<105, 110, 100, 101, 120, 46, 106, 115, 111, 110>>,
  [{:users, _}, ...]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:257:no_return
Function unsuggest/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:267:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:nicknames => _, _ => _},
    _ => _
  },
  <<105, 110, 100, 101, 120, 46, 106, 115, 111, 110>>,
  [{:users, _}, ...]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:270:no_return
Function index/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:294:unused_fun
Function maybe_parse_filters/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:303:no_return
Function page_params/1 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:305:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.fetch_integer_param(_params :: any(), :page, 1)

breaks the contract
(map(), String.t(), integer() | nil) :: integer() | nil
2024-01-28 16:05:25 -05:00
Mark Felder db87be126e Pleroma.Web.AdminAPI.InviteController: dialyzer errors
lib/pleroma/web/admin_api/controllers/invite_controller.ex:46:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{:body_params => %{:token => _, _ => _}, _ => _},
  <<115, 104, 111, 119, 46, 106, 115, 111, 110>>,
  [
    {:invite,
     %Pleroma.UserInviteToken{
       :__meta__ => _,
       :expires_at => _,
       :id => _,
       :inserted_at => _,
       :invite_type => _,
       :max_use => _,
       :token => _,
       :updated_at => _,
       :used => _,
       :uses => _
     }},
    ...
  ]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/invite_controller.ex:66:call
The function call will not succeed.

Pleroma.Web.ControllerHelper.json_response(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:email => _, _ => _},
    _ => _
  },
  :no_content,
  <<>>
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | 1..1_114_111,
  any()
)
2024-01-28 15:53:47 -05:00
Mark Felder 8d64eedbec Pleroma.Web.PleromaAPI.ChatController: Dialyzer error
lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:128:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:last_read_id => _, _ => _},
    _ => _
  },
  <<115, 104, 111, 119, 46, 106, 115, 111, 110>>,
  [
    {:chat,
     %Pleroma.Chat{
       :__meta__ => _,
       :id => _,
       :inserted_at => _,
       :recipient => _,
       :updated_at => _,
       :user => _,
       :user_id => _
     }},
    ...
  ]
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()
2024-01-28 15:52:09 -05:00
Mark Felder 456f7cab3e Pleroma.Web.PleromaAPI.ChatController: Dialyzer errors
lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:91:pattern_match
The pattern can never match the type.

Pattern:
{:reject, _message}

Type:
nil

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:96:pattern_match
The pattern can never match the type.

Pattern:
{:error, _message}

Type:
nil
2024-01-28 15:52:09 -05:00
Mark Felder dc912dc590 Pleroma.Web.PleromaAPI.EmojiFileController: dialyzer errors
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:52:no_return
Function update/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:59:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, %{
  binary() =>
    binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | char(),
        binary() | []
      )
})

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:62:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, :conflict)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:70:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _}, :unprocessable_entity) ::
  :ok
def a() do
  :ok
end

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:75:call
The function call will not succeed.

Pleroma.Web.PleromaAPI.EmojiFileController.handle_error(
  _conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _},
  _error :: {:error, atom()},
  %{:code => _, :message => <<_::328>>, :pack_name => binary()}
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  {:error, atom()},
  %{:message => <<_::328, _::size(88)>>, :pack_name => binary(), :code => _}
)

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex:75:call
The function call will not succeed.

Pleroma.Web.PleromaAPI.EmojiFileController.handle_error(
  _conn :: %{:body_params => %{:shortcode => _, _ => _}, _ => _},
  _error :: {:error, atom()},
  %{:code => binary(), :message => <<_::328>>, :pack_name => binary()}
)

will never return since the 1st arguments differ
from the success typing arguments:

(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() =>
        binary() | [binary() | [any()] | map()] | %{binary() => binary() | [any()] | map()}
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{binary(), binary()}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{binary(), binary()}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  {:error, atom()},
  %{:message => <<_::328, _::size(88)>>, :pack_name => binary(), :code => _}
)
2024-01-28 15:52:09 -05:00
Mark Felder 77bf617c4b Pleroma.Web.PleromaAPI.EmojiPackController: dialyzer errors
________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:112:no_return
Function download/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:114:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:name => _, :url => _, _ => _}, _ => _}, <<111, 107>>)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:117:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{:body_params => %{:name => _, :url => _, _ => _}, _ => _},
  :internal_server_error
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:122:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{:body_params => %{:name => _, :url => _, _ => _}, _ => _},
  :internal_server_error
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:127:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{:body_params => %{:name => _, :url => _, _ => _}, _ => _},
  :internal_server_error
)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:187:no_return
Function update/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:189:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:metadata => _, _ => _}, _ => _}, map())

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:192:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:metadata => _, _ => _}, _ => _}, :bad_request)

breaks the contract
(t(), status()) :: t()

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:203:call
The function call will not succeed.

Plug.Conn.put_status(_conn :: %{:body_params => %{:metadata => _, _ => _}, _ => _}, :internal_server_error) ::
  :ok
def a() do
  :ok
end

breaks the contract
(t(), status()) :: t()
2024-01-28 15:52:09 -05:00
Mark Felder a32d6b3aa4 Pleroma.Web.PleromaAPI.MascotController: dialyzer error
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:33:pattern_match
The pattern can never match the type.

Pattern:
{:content_type, _}

Type:
{:error, _}
2024-01-28 15:52:09 -05:00
Mark Felder 9c8055d4b3 Pleroma.Web.PleromaAPI.MascotController: dialyzer errors
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:25:no_return
Function update/2 has no local return.

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:27:call
The function call will not succeed.

Pleroma.Web.ActivityPub.ActivityPub.upload(_file :: atom() | %{:content_type => _, _ => _}, [{:actor, <<_::56, _::size(8)>>}, ...]) ::
  :ok
def a() do
  :ok
end

will never return since the 2nd arguments differ
from the success typing arguments:

(any(), [
  {:activity_type | :description | :filters | :size_limit | :type | :uploader,
   atom() | binary() | [atom()] | non_neg_integer()}
])

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:31:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:file => _, _ => _},
    _ => _
  },
  _attachment :: any()
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:34:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:file => _, _ => _},
    _ => _
  },
  :unsupported_media_type
)

breaks the contract
(t(), status()) :: t()

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:34:call
The function call will not succeed.

Plug.Conn.put_status(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:file => _, _ => _},
    _ => _
  },
  :unsupported_media_type
)

breaks the contract
(t(), status()) :: t()

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:38:unused_fun
Function render_attachment/1 will never be called.
2024-01-28 15:52:09 -05:00
Mark Felder 60d89cb404 Pleroma.Web.AdminAPI.ConfigController: dialyzer error
lib/pleroma/web/admin_api/controllers/config_controller.ex:162:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{:body_params => %{:configs => _, _ => _}, _ => _},
  <<105, 110, 100, 101, 120, 46, 106, 115, 111, 110>>,
  %{:configs => [any()], :need_reboot => _}
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()
2024-01-27 16:42:30 -05:00
Mark Felder 26a95e5787 Pleroma.Web.PleromaAPI.NotificationController: dialyzer errors
lib/pleroma/web/pleroma_api/controllers/user_import_controller.ex:53:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:list => _, _ => _},
    _ => _
  },
  <<106, 111, 98, 32, 115, 116, 97, 114, 116, 101, 100>>
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-27 16:15:03 -05:00
Mark Felder 52e18a6249 Pleroma.Web.PleromaAPI.UserImportController: Dialyzer errors
lib/pleroma/web/pleroma_api/controllers/user_import_controller.ex:53:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:list => _, _ => _},
    _ => _
  },
  <<106, 111, 98, 32, 115, 116, 97, 114, 116, 101, 100>>
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-27 15:57:21 -05:00
Mark Felder 17f4251b19 Pleroma.Web.TwitterAPI.UtilController: dialyzer fixes
lib/pleroma/web/twitter_api/controllers/util_controller.ex:158:call
The function call will not succeed.

Phoenix.Controller.json(_conn :: %{:body_params => %{:ap_id => _, :profile => _, _ => _}, _ => _}, %{
  :error =>
    <<67, 111, 117, 108, 100, 110, 39, 116, 32, 102, 105, 110, 100, 32, 117, 115, 101, 114>>
})

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-27 15:47:07 -05:00
Mark Felder 8b02c85810 Pleroma.Web.AdminAPI.MediaProxyCacheController: dialyzer errors
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex:64:call
The function call will not succeed.

Phoenix.Controller.json(
  _conn :: %{
    :assigns => %{:user => _, _ => _},
    :body_params => %{:urls => _, _ => _},
    _ => _
  },
  %{}
)

breaks the contract
(Plug.Conn.t(), term()) :: Plug.Conn.t()
2024-01-27 15:41:14 -05:00
Mark Felder 5c193a34a2 Pleroma.Web.ActivityPub.SideEffects: dialyzer errors
lib/pleroma/web/activity_pub/side_effects.ex:544:call
The function call will not succeed.

Pleroma.Web.ActivityPub.SideEffects.delete_object(
  _object :: %Pleroma.Activity{
    :__meta__ => _,
    :actor => _,
    :bookmark => _,
    :data => map(),
    :id => _,
    :inserted_at => _,
    :local => _,
    :notifications => _,
    :object => _,
    :pagination_id => _,
    :recipients => _,
    :report_notes => _,
    :thread_muted? => _,
    :updated_at => _,
    :user_actor => _
  }
)

breaks the contract
(Pleroma.Object.t()) :: :ok | {:error, Ecto.Changeset.t()}
2024-01-27 15:05:12 -05:00
Mark Felder b6a1e7fb31 Pleroma.Web.ActivityPub.SideEffects: dialyzer errors
lib/pleroma/web/activity_pub/side_effects.ex:622:callback_type_mismatch
Type mismatch for @callback handle_after_transaction/1 in Pleroma.Web.ActivityPub.SideEffects.Handling behaviour.

Expected type:
map()

Actual type:
Keyword.t()

lib/pleroma/web/activity_pub/side_effects.ex:622:callback_arg_type_mismatch
The inferred type for the 1st argument is not a
supertype of the expected type for the handle_after_transaction/1 callback
in the Pleroma.Web.ActivityPub.SideEffects.Handling behaviour.

Success type:
Keyword.t()

Behaviour callback type:
map()
2024-01-27 15:02:20 -05:00
Mark Felder 5f5bd64b83 Pleroma.Web.ActivityPub.SideEffects: dialyzer errors
lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match
The pattern can never match the type.

Pattern:
{:actor, _}

Type:
{:error, boolean()}

lib/pleroma/web/activity_pub/side_effects.ex:328:pattern_match
The pattern can never match the type.

Pattern:
{:actor, _}

Type:
nil
2024-01-27 14:55:29 -05:00
Mark Felder 94d7e28cbe Pleroma.Web.ActivityPub.ObjectValidator: dialyzer error
lib/pleroma/web/activity_pub/object_validator.ex:165:pattern_match
The pattern can never match the type.

Pattern:
{:local, _}

Type:

  {:error,
   %Ecto.Changeset{
     :action => atom(),
     :changes => %{atom() => _},
     :constraints => [
       %{
         :constraint =>
           binary()
           | %Regex{
               :opts => binary() | [any()],
               :re_pattern => _,
               :re_version => _,
               :source => binary()
             },
         :error_message => binary(),
         :error_type => atom(),
         :field => atom(),
         :match => :exact | :prefix | :suffix,
         :type => :check | :exclusion | :foreign_key | :unique
       }
     ],
     :data => nil | map(),
     :empty_values => _,
     :errors => Keyword.t({binary(), Keyword.t()}),
     :filters => %{atom() => _},
     :params => nil | %{binary() => _},
     :prepare => [(_ -> any())],
     :repo => atom(),
     :repo_opts => Keyword.t(),
     :required => [atom()],
     :types =>
       nil
       | %{
           atom() =>
             atom()
             | {:array | :assoc | :embed | :in | :map | :maybe | :param, _}
             | {:parameterized, atom(), _}
         },
     :valid? => boolean(),
     :validations => Keyword.t()
   }}
2024-01-27 14:29:48 -05:00
Mark Felder 06b8923d42 RichMedia.Parser.TTL.AwsSignedUrl: dialyzer fix
lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex:9:callback_type_mismatch
Type mismatch for @callback ttl/2 in Pleroma.Web.RichMedia.Parser.TTL behaviour.

Expected type:
nil | integer()

Actual type:
{:error, <<_::64, _::size(8)>>} | {:ok, integer()}
2024-01-26 17:37:32 -05:00
Mark Felder 28af5e3bd7 TwitterAPI.UtilController: fix dialyzer errors
lib/pleroma/web/twitter_api/controllers/util_controller.ex:300:pattern_match
The pattern can never match the type.

Pattern:
{:error, :no_such_alias}

Type:
{:not_found, nil}

lib/pleroma/web/twitter_api/controllers/util_controller.ex:304:pattern_match
The pattern can never match the type.

Pattern:
{:error, _error}

Type:
{:not_found, nil}
2024-01-26 17:22:27 -05:00
Mark Felder 5b95abaeea Credo.Check.Readability.PredicateFunctionNames
This check was recently improved in Credo and it does make sense for readability.

The offending functions in Pleroma have been renamed and a couple missing the ? suffix have been fixed as well.
2024-01-26 16:59:58 -05:00
Mark Felder 18d38486a5 InetCidr.parse/2 is deprecated 2024-01-26 15:57:50 -05:00
Haelwenn (lanodan) Monnier 799891d359
Transmogrifier: Cleanup obsolete handling of "contentMap": null 2024-01-26 17:10:10 +01:00
Haelwenn (lanodan) Monnier acef2a4a40
CommonFixes: Use Maps.filter_empty_values on fix_object_defaults 2024-01-26 16:19:25 +01:00
Mark Felder 3a8594e927 MastodonAPI.Controller.StatusController: fix dialyzer error
lib/pleroma/web/mastodon_api/controllers/status_controller.ex:333:pattern_match
The pattern can never match the type.

Pattern:
{:ok, _activity}

Type:
{:error, _}
2024-01-22 18:37:29 -05:00
Mark Felder 115b2ad638 MRF.KeywordPolicy: fix dialyzer error
lib/pleroma/web/activity_pub/mrf/keyword_policy.ex:13:neg_guard_fail
Guard test:
not is_binary(_string :: binary())

can never succeed.
2024-01-22 18:37:29 -05:00
Mark Felder 0dd65246ea MRF.HashtagPolicy: fix dialyzer error
lib/pleroma/web/activity_pub/mrf/hashtag_policy.ex:87:exact_eq
The test <<_::32>> == <<_::48>> can never evaluate to 'true'.
2024-01-22 18:37:19 -05:00
Mark Felder 5f71928f6b MRF.InlineQuotePolicy: fix dialyzer error
lib/pleroma/web/activity_pub/mrf/inline_quote_policy.ex:60:callback_type_mismatch
Type mismatch for @callback config_description/0 in Pleroma.Web.ActivityPub.MRF.Policy behaviour.

Expected type:
%{
  :description => binary(),
  :key => atom(),
  :label => binary(),
  :related_policy => binary(),
  :children => [map()]
}

Actual type:
%{
  :children => [
    %{
      :description => <<_::808>>,
      :key => :template,
      :suggestions => [any(), ...],
      :type => :string
    },
    ...
  ],
  :description => <<_::336>>,
  :key => :mrf_inline_quote,
  :label => <<_::184>>,
  :related_policy => <<_::360>>,
  :type => :group
}
2024-01-22 18:37:13 -05:00
Mark Felder 36355d3ed9 Pleroma.Web.ActivityPub.Builder: fix dialyzer error
lib/pleroma/web/activity_pub/builder.ex:205:unknown_type
Unknown type: Pleroma.Web.CommonAPI.ActivityDraft.t/0.
2024-01-22 18:37:13 -05:00
Mark Felder 39da451b6d Pleroma.Web.ActivityPub.Builder: fix dialyzer errors
lib/pleroma/web/activity_pub/builder.ex:35:unknown_type
Unknown type: Activity.t/0.

lib/pleroma/web/activity_pub/builder.ex:40:unknown_type
Unknown type: Activity.t/0.

lib/pleroma/web/activity_pub/builder.ex:144:unknown_type
Unknown type: Activity.t/0.
________________________________________________________________________________
lib/pleroma/web/activity_pub/builder.ex:204:unknown_type
Unknown type: Pleroma.Web.CommonAPI.ActivityDraft.t/0.
2024-01-22 18:37:13 -05:00
Mark Felder 6df93e61c4 Use config to determine sending to the streamer registry instead of MIX_ENV compile time function definition 2024-01-22 18:37:13 -05:00
marcin mikołajczak def088ce52 format
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-01-21 18:23:24 +01:00
Haelwenn ab3f03a04a Merge branch 'develop' into 'public-polls'
# Conflicts:
#   docs/development/API/differences_in_mastoapi_responses.md
2024-01-21 12:03:29 +00:00
Mark Felder c7eda0b24a Use config to control loading of custom modules 2024-01-20 18:43:53 -05:00
Mark Felder 7f649a7a19 Dialyzer: remove function that will never match 2024-01-20 17:50:21 -05:00
Mark Felder 83eece7764 Fix invalid type
lib/pleroma/web/auth/authenticator.ex:8:unknown_type
Unknown type: User.t/0.
2024-01-20 17:33:37 -05:00
Mark Felder 4f07116108 Fix invalid type
lib/pleroma/web/activity_pub/publisher.ex:31:unknown_type
Unknown type: Map.t/0.
2024-01-20 17:32:19 -05:00
Mark Felder ec5ae83da6 Fix invalid types
lib/pleroma/web/activity_pub/mrf/policy.ex:6:unknown_type
Unknown type: Map.t/0.

lib/pleroma/web/activity_pub/mrf/policy.ex:7:unknown_type
Unknown type: Map.t/0.
2024-01-20 17:31:07 -05:00
Mark Felder f050a75b92 Fix invalid types due to typos
lib/pleroma/web/feed/feed_view.ex:135:unknown_type
Unknown type: NativeDateTime.t/0.

lib/pleroma/web/feed/feed_view.ex:148:unknown_type
Unknown type: NativeDateTime.t/0.
2024-01-20 17:22:40 -05:00
Mark Felder e5120a2703 Fix invalid type due to typos
lib/pleroma/web/o_auth/authorization.ex:61:unknown_type
Unknown type: Authtorizatiton.t/0.
2024-01-20 17:21:12 -05:00
Mark Felder 65dfaa6cb9 Fix invalid type due to late aliasing
lib/pleroma/web/o_auth/token/query.ex:12:unknown_type
Unknown type: Token.t/0.
2024-01-20 17:18:16 -05:00
Mark Felder 09ae0ab24a Fix invalid type
lib/pleroma/web/rich_media/parser.ex:105:unknown_type
Unknown type: Integer.t/0.
2024-01-20 17:16:10 -05:00
Mark Felder 467a65af90 Fix invalid types
lib/pleroma/web/rich_media/parser/ttl.ex:6:unknown_type
Unknown type: Integer.t/0.

lib/pleroma/web/rich_media/parser/ttl.ex:6:unknown_type
Unknown type: Map.t/0.
2024-01-20 17:14:56 -05:00
Mark Felder e3f52ee13f Fix invalid types
lib/pleroma/web/streamer.ex:37:unknown_type
Unknown type: Map.t/0.
________________________________________________________________________________
lib/pleroma/web/streamer.ex:63:unknown_type
Unknown type: Map.t/0.
2024-01-20 17:14:10 -05:00
Mark Felder 0b7d214211 Fix invalid typespec references to Ecto.Changeset.t() 2024-01-20 16:47:50 -05:00
Mark Felder dc8045d766 FlakeId.Ecto.CompatType.t() does not exist
This type is not exported and usable. FlakeId intends to return the type as :uuid, so we replace it in the typespecs with Ecto.UUID.t() which assuages the dialyzer errors

e.g.,

lib/pleroma/bookmark.ex:25:unknown_type
Unknown type: FlakeId.Ecto.CompatType.t/0.
2024-01-20 16:36:01 -05:00
Mark Felder b16a01ba9d Pleroma.ApplicationRequirements: fix dialyzer errors
lib/pleroma/application_requirements.ex:19:unknown_type
Unknown type: Pleroma.ApplicationRequirements.VerifyError.t/0.

lib/pleroma/application_requirements.ex:199:pattern_match_cov
The pattern
variable_result

can never match, because previous clauses completely cover the type
:ok.
2024-01-20 16:10:11 -05:00
Mark Felder 2a28377be0 Fix mix task pleroma.instance dialyzer error
lib/mix/tasks/pleroma/instance.ex:356:pattern_match_cov
The pattern
:variable_

can never match, because previous clauses completely cover the type
%{
  :anonymize => boolean(),
  :dedupe => boolean(),
  :read_description => boolean(),
  :strip_location => boolean()
}.
2024-01-20 15:55:33 -05:00
Haelwenn a5f64ffd0c Apply lanodan’s suggestion to 1 file 2024-01-19 21:28:15 +00:00
Haelwenn 3c65a2899d Merge branch 'handle_object_fetch_failures' into 'develop'
Handle object fetch failures gracefully

See merge request pleroma/pleroma!4015
2024-01-19 18:43:00 +00:00
marcin mikołajczak b39403a48f Update API docs for my changes
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-01-17 17:13:21 +01:00
Haelwenn 4c20713ecd Merge branch 'otp26' into 'develop'
OTP26 support

See merge request pleroma/pleroma!4025
2024-01-17 09:51:56 +00:00
Haelwenn 9b39bc6aa8 Merge branch 'mrf-regex-error' into 'develop'
MRF: Log sensible regex error for subdomain_match

See merge request pleroma/pleroma!4026
2024-01-15 08:24:54 +00:00
Haelwenn c29430b018 Merge branch 'mrf-steal-emoji-extname' into 'develop'
MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing one

See merge request pleroma/pleroma!4029
2024-01-15 08:24:24 +00:00
tusooa d3a4f5b7d7 Merge branch 'nil-contentMap' into 'develop'
Support objects with a nil contentMap (firefish)

Closes #3231

See merge request pleroma/pleroma!4030
2024-01-13 22:23:21 +00:00
Mint 3c30eadd5e Fix duplicate inbox deliveries 2024-01-11 20:48:35 +03:00
Haelwenn (lanodan) Monnier 7651198508 Support objects with a nil contentMap (firefish)
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3231
2024-01-11 07:16:45 +01:00