summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-27Pleroma.Web.TwitterAPI.UtilController: dialyzer fixesMark Felder
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-27Pleroma.Web.AdminAPI.MediaProxyCacheController: dialyzer errorsMark Felder
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-27These are all due to Cachex typespec bugsMark Felder
2024-01-27Pleroma.Web.ActivityPub.SideEffects: dialyzer errorsMark Felder
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-27Pleroma.Web.ActivityPub.SideEffects: dialyzer errorsMark Felder
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-27Pleroma.Web.ActivityPub.SideEffects: dialyzer errorsMark Felder
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-27Pleroma.Web.ActivityPub.ObjectValidator: dialyzer errorMark Felder
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-27Pleroma.Gun.ConnectionPool.Reclaimer: dialyzer errorMark Felder
lib/pleroma/gun/connection_pool/reclaimer.ex:12:call The function call will not succeed. :gen_server.start(Pleroma.Gun.ConnectionPool.Reclaimer, [], [ {:name, {:via, Registry, {Pleroma.Gun.ConnectionPool, <<_::72>>}}}, ... ]) will never return since the success typing is: (atom(), any(), [ {:debug, [:log | :statistics | :trace | {_, _}]} | {:hibernate_after, timeout()} | {:spawn_opt, [:link | :monitor | {_, _}]} | {:timeout, timeout()} ]) :: :ignore | {:error, _} | {:ok, pid() | {pid(), reference()}} and the contract is (Module :: module(), Args :: term(), Options :: [start_opt()]) :: start_ret()
2024-01-27Pleroma.Emoji: dialyzer errorMark Felder
lib/pleroma/emoji.ex:54:unknown_type Unknown type: Emoji.t/0.
2024-01-27Pleroma.Object: dialyzer errorMark Felder
lib/pleroma/object.ex:245:call The function call will not succeed. Pleroma.Object.cleanup_attachments(any(), %{<<_::48>> => %Pleroma.Object{:data => map(), atom() => _}}) breaks the contract (boolean(), %{:object => map()}) :: {:ok, Oban.Job.t() | nil}
2024-01-27Pleroma.Web.ActivityPub.Builder: fix dialyzer errorMark Felder
lib/pleroma/web/activity_pub/builder.ex:115:pattern_match The pattern can never match the type. Pattern: _emojo = %{:file => _path} Type: nil | binary()
2024-01-27Pleroma.ReverseProxy: dialyzer errorsMark Felder
lib/pleroma/reverse_proxy.ex:225:pattern_match The pattern can never match the type. Pattern: :done Type: {:ok, :no_duration_limit, :no_duration_limit} lib/pleroma/reverse_proxy.ex:226:pattern_match The pattern can never match the type. Pattern: {:error, _error} Type: {:ok, :no_duration_limit, :no_duration_limit} lib/pleroma/reverse_proxy.ex:391:pattern_match The pattern can never match the type. Pattern: __duration = nil, _max Type: integer(), _
2024-01-27Merge branch 'dialyzer-fixes' into 'develop'feld
Dialyzer fixes See merge request pleroma/pleroma!4047
2024-01-27FormattingMark Felder
2024-01-26ChangelogMark Felder
2024-01-26Pleroma.Helpers.QtFastStart: Dialzyer errorMark Felder
lib/pleroma/helpers/qt_fast_start.ex:129:improper_list_constr List construction (cons) will produce an improper list, because its second argument is <<_::32>>. lib/pleroma/helpers/qt_fast_start.ex:129:improper_list_constr List construction (cons) will produce an improper list, because its second argument is <<_::64>>.
2024-01-26Pleroma.ModerationLog: fix invalid typeMark Felder
2024-01-26Pleroma.Search.SearchBackend: dialyzer errorMark Felder
Incorrect spec. Both search backends return :ok so that is what should be the spec. lib/pleroma/search/database_search.ex:56:callback_type_mismatch Type mismatch for @callback remove_from_index/1 in Pleroma.Search.SearchBackend behaviour. Expected type: {:error, _} | {:ok, _} Actual type: :ok
2024-01-26Pleroma.Signature: dialyzer errorMark Felder
lib/pleroma/signature.ex:30:pattern_match The pattern can never match the type. Pattern: %{<<97, 112, 95, 105, 100>> => _ap_id} Type: {:error, _} | {:ok, map()}
2024-01-26Pleroma.Upload: dialyzer errorMark Felder
I have opted to set this to :upper as this retains the same behavior but clears up the error. lib/pleroma/upload.ex:178:call The function call will not succeed. Base.encode16(binary(), [{:lower, true}]) breaks the contract (binary(), [{:case, encode_case()}]) :: binary()
2024-01-26RichMedia.Parser.TTL.AwsSignedUrl: dialyzer fixMark Felder
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-26TwitterAPI.UtilController: fix dialyzer errorsMark Felder
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-26Credo.Check.Readability.PredicateFunctionNamesMark Felder
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-26InetCidr.parse/2 is deprecatedMark Felder
2024-01-26Bump dependenciesHaelwenn (lanodan) Monnier
2024-01-26Merge branch 'elixir-1.15-base' into 'develop'feld
CI: pin 1.15 to otp25 See merge request pleroma/pleroma!4046
2024-01-26Pin to otp25Mark Felder
The 1.15.7 image by default uses OTP26 now, but we really want otp25
2024-01-26Merge branch 'elixir-1.15-base' into 'develop'feld
CI: set correct image version for Elixir 1.15 See merge request pleroma/pleroma!4045
2024-01-26Set correct image versionMark Felder
2024-01-26Transmogrifier: Cleanup obsolete handling of `"contentMap": null`Haelwenn (lanodan) Monnier
2024-01-26Test incoming federation from Convergence AP BridgeHaelwenn (lanodan) Monnier
2024-01-26CommonFixes: Use Maps.filter_empty_values on fix_object_defaultsHaelwenn (lanodan) Monnier
2024-01-26Maps: Add filter_empty_values/1Haelwenn (lanodan) Monnier
2024-01-23Merge branch 'dialyzer-fixes' into 'develop'feld
More dialyzer fixes See merge request pleroma/pleroma!4042
2024-01-22MastodonAPI.Controller.StatusController: fix dialyzer errorMark Felder
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-22Clear up missing function dialyzer errors for :eldapMark Felder
2024-01-22MRF.KeywordPolicy: fix dialyzer errorMark Felder
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-22MRF.HashtagPolicy: fix dialyzer errorMark Felder
lib/pleroma/web/activity_pub/mrf/hashtag_policy.ex:87:exact_eq The test <<_::32>> == <<_::48>> can never evaluate to 'true'.
2024-01-22MRF.InlineQuotePolicy: fix dialyzer errorMark Felder
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-22Pleroma.Migrators.Support.BaseMigrator: Fix dialyzer errorsMark Felder
lib/pleroma/migrators/context_objects_deletion_migrator.ex:13:exact_eq The test :error | float() == 0 can never evaluate to 'true'. lib/pleroma/migrators/hashtags_table_migrator.ex:13:exact_eq The test :error | float() == 0 can never evaluate to 'true'.
2024-01-22Pleroma.Gun.ConnectionPool.WorkerSupervisor: fix dialyzer errorMark Felder
lib/pleroma/gun/connection_pool/worker_supervisor.ex:24:guard_fail The guard clause: when _ :: true === nil can never succeed.
2024-01-22Pleroma.HTTP.AdapterHelper: fix dialyzer errorsMark Felder
lib/pleroma/http/adapter_helper.ex:18:unknown_type Unknown type: Connection.host/0. lib/pleroma/http/adapter_helper.ex:19:unknown_type Unknown type: Connection.host/0. lib/pleroma/http/adapter_helper.ex:19:unknown_type Unknown type: Connection.proxy_type/0.
2024-01-22Pleroma.Migrators.Support.BaseMigratorState: fix dialyzer errorMark Felder
lib/pleroma/migrators/support/base_migrator_state.ex:10:unknown_type Unknown type: Pleroma.DataMigration.t/0.
2024-01-22Pleroma.Web.ActivityPub.Builder: fix dialyzer errorMark Felder
lib/pleroma/web/activity_pub/builder.ex:205:unknown_type Unknown type: Pleroma.Web.CommonAPI.ActivityDraft.t/0.
2024-01-22Pleroma.Web.ActivityPub.Builder: fix dialyzer errorsMark Felder
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-22Pleroma.User.Query: fix dialyzer errorMark Felder
lib/pleroma/user/query.ex:74:unknown_type Unknown type: Query.t/0.
2024-01-22Pleroma.User: fix dialyzer errorsMark Felder
lib/pleroma/user.ex:1514:unknown_type Unknown type: Pleroma.UserRelationship.t/0. lib/pleroma/user.ex:2629:unknown_type Unknown type: Pleroma.UserRelationship.t/0. lib/pleroma/user.ex:2638:unknown_type Unknown type: Pleroma.UserRelationship.t/0.
2024-01-22Pleroma.User.Backup: fix some dialyzer errorsMark Felder
lib/pleroma/user/backup.ex:207:call The function call will not succeed. :zip.create( string(), [:"\"actor.json\"", :"\"outbox.json\"", :"\"likes.json\"", :"\"bookmarks.json\""], [{:cwd, binary()}, ...] ) will never return since the success typing is: ( atom() | [atom() | [any()] | char()], [ atom() | [atom() | [any()] | char()] | {atom() | [atom() | [any()] | char()], binary()} | {atom() | [atom() | [any()] | char()], binary(), {:file_info, :undefined | non_neg_integer(), :device | :directory | :other | :regular | :symlink | :undefined, :none | :read | :read_write | :undefined | :write, :undefined | non_neg_integer() | {_, _}, :undefined | non_neg_integer() | {_, _}, :undefined | non_neg_integer() | {_, _}, :undefined | non_neg_integer(), :undefined | non_neg_integer(), :undefined | non_neg_integer(), :undefined | non_neg_integer(), :undefined | non_neg_integer(), :undefined | non_neg_integer(), :undefined | non_neg_integer()}} ], [ :cooked | :memory | :verbose | {:comment, string()} | {:compress, :all | [[any()]] | {:add, [any()]} | {:del, [any()]}} | {:cwd, string()} | {:uncompress, :all | [[any()]] | {:add, [any()]} | {:del, [any()]}} ] ) :: {:error, _} | {:ok, atom() | [atom() | [any()] | char()] | {atom() | [atom() | [any()] | char()], binary()}} and the contract is (name, fileList, options) :: retValue when name: :file.name(), fileList: [:FileSpec], fileSpec: :file.name() | {:file.name(), binary()} | {:file.name(), binary(), :file.file_info()}, options: [:Option], option: create_option(), retValue: {:ok, FileName :: filename()} | {:ok, {FileName :: filename(), binary()}} | {:error, Reason :: term()}
2024-01-22Exile: fix for MacOS dev environmentsMark Felder
2024-01-22Announcement: fix dialyzer errors and add typespec for the changesetMark Felder
It was possible for this to raise (no_local_return) because the data key could be missing from the params