spc-pleroma/lib/pleroma/web
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
..
activity_pub Merge branch 'deps-bump' into 'develop' 2024-01-29 17:43:00 +00:00
admin_api Pleroma.Web.AdminAPI.UserController: dialyzer errors 2024-01-28 17:14:37 -05:00
api_spec Pleroma.Web.MastodonAPI.MediaController: dialyzer errors 2024-01-29 18:36:46 -05:00
auth Fix invalid type 2024-01-20 17:33:37 -05:00
channels Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
common_api Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
fallback RedirectController: Unify server-generated-meta insertion code 2023-11-14 11:06:36 +01:00
federator Retire the Pleroma.Web.Federator.Publisher module 2023-12-28 14:53:09 -05:00
feed Fix invalid types due to typos 2024-01-20 17:22:40 -05:00
mailer Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
mastodon_api Pleroma.Web.MastodonAPI.MediaController: dialyzer errors 2024-01-29 18:36:46 -05:00
media_proxy Revert MediaProxy Host header validation 2023-06-07 09:19:22 -04:00
metadata twitter card: handle case where image has no alt text 2023-05-29 02:52:49 +05:00
mongoose_im Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
nodeinfo Remove support for multiple federation publisher modules 2023-12-28 11:55:19 -05:00
o_auth Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
o_status Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
pleroma_api Pleroma.Web.PleromaAPI.ChatController: Dialyzer error 2024-01-28 15:52:09 -05:00
plugs Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
preload/providers Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
push Elixir 1.15: Chase the Logger.warn deprecation 2023-12-20 20:16:26 +00:00
rich_media Merge branch 'deps-bump' into 'develop' 2024-01-29 17:43:00 +00:00
static_fe Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
templates Fix deprecated calls to get_flash/2 2023-05-31 13:36:21 -04:00
twitter_api Merge branch 'deps-bump' into 'develop' 2024-01-29 17:43:00 +00:00
utils Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
views Use pleroma: instead of pleroma. for ws events 2023-10-15 17:20:25 -04:00
web_finger Phoenix detects the webfinger requests with content-type application/jrd+json as "jrd" now 2023-12-29 23:18:45 -05:00
api_spec.ex Fix some more typos 2023-12-28 00:17:04 +01:00
common_api.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
controller_helper.ex Pleroma.Web.ControllerHelper: dialyzer error 2024-01-29 16:42:48 -05:00
embed_controller.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
endpoint.ex Switch to PromEx for prometheus metrics 2023-11-13 15:34:59 -05:00
federator.ex Fix the Federator perform/2 Oban callback 2023-12-28 22:51:47 -05:00
gettext.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
instance_document.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
manifest_controller.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
media_proxy.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
metadata.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
multipart.ex endpoint: Use custom Multipart module for dynamic configuration 2023-06-27 10:41:25 +02:00
o_auth.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
plug.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
preload.ex B Preload: Make sure that the preloaded json is html safe 2023-06-02 17:03:21 +04:00
push.ex Elixir 1.15: Chase the Logger.warn deprecation 2023-12-20 20:16:26 +00:00
rel_me.ex Remove unwanted code specific to MIX_ENV=test 2023-02-20 12:24:38 -05:00
router.ex Phoenix detects the webfinger requests with content-type application/jrd+json as "jrd" now 2023-12-29 23:18:45 -05:00
shout_channel.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
streamer.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
translation_helpers.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
uploader_controller.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
web_finger.ex Remove support for multiple federation publisher modules 2023-12-28 11:55:19 -05:00
xml.ex Completely disable xml entity resolution 2023-08-05 14:17:04 +02:00