summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-02-20StealEmojiPolicy: Sanitize shortcodesHaelwenn (lanodan) Monnier
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3245
2024-02-15Merge branch 'websocket-refactor' into 'develop'feld
Websocket refactor to use Phoenix.Socket.Transport See merge request pleroma/pleroma!4064
2024-02-15Merge branch 'bugfix-ccworks' into 'develop'Haelwenn
Bugfix for ccworks AP bridge Closes #3234 See merge request pleroma/pleroma!4043
2024-02-14Remove invalid testMark Felder
It is not allowed to use the Sec-WebSocket-Protocol header for arbitrary values. This was possible due to the raw websocket handling we were doing with Cowboy, but Phoenix.Socket.Transport does not allow this as the value of this header is compared against a static list of subprotocols. https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-websocket-configuration Additionally I cannot find anywhere that we depended on this behavior. Setting the Sec-WebSocket-Protocol header does not appear to be a part of PleromaFE.
2024-02-06Pleroma.Web.RichMedia.Parser: Remove test-specific codepathsMark Felder
Also consolidate Tesla mocks into the HttpRequestMock module. Tests were not exercising the real codepaths. The Rich Media Preview only works with https, but most of these tests were only mocking http.
2024-02-05Ensure URLs with IP addresses for the host do not generate previewsMark Felder
2024-02-04Fix Rich Media Previews for updated activitiesMark Felder
The Rich Media Previews were not regenerated when a post was updated due to a cache invalidation issue. They are now cached by the activity id so they can be evicted with the other activity cache objects in the :scrubber_cache.
2024-01-30Phoenix.Endpoint.Cowboy2Handler does not existMark Felder
This should have always failed as it would not be an existing atom. Unclear how it worked since the upgrade to Phoenix 1.6.
2024-01-30Revert "Pleroma.Web.AdminAPI.ConfigController: dialyzer error"Mark Felder
This reverts commit 60d89cb40455f9f70b683849dd95311975b0b6f7.
2024-01-29Pleroma.Web.MediaProxy.MediaProxyController: dialyzer errorsMark Felder
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-29Merge branch 'deps-bump' into 'develop'Haelwenn
Bump dependencies See merge request pleroma/pleroma!4044
2024-01-27Pleroma.Web.AdminAPI.ConfigController: dialyzer errorMark Felder
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-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-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-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-26Test incoming federation from Convergence AP BridgeHaelwenn (lanodan) Monnier
2024-01-26Maps: Add filter_empty_values/1Haelwenn (lanodan) Monnier
2024-01-19Merge branch 'handle_object_fetch_failures' into 'develop'Haelwenn
Handle object fetch failures gracefully See merge request pleroma/pleroma!4015
2024-01-17Merge branch 'otp26' into 'develop'Haelwenn
OTP26 support See merge request pleroma/pleroma!4025
2024-01-15Skip tests on MacOS/Darwin that have always failedMark Felder
2024-01-16Pleroma.Web.MastodonAPI.SubscriptionControllerTest: disable async and use ↵Mark Felder
on_exit/1 to ensure web push config gets restored
2024-01-15Fix StatusController test by using the get_query_parameter/2 helper to ↵Mark Felder
reliably retrieve the max_id value
2024-01-15Add Pleroma.Test.Helpers.get_query_parameter/2 to retrieve specific query ↵Mark Felder
parameter values
2024-01-15Fix ChatController tests validating prev/next URLs by sorting the query ↵Mark Felder
parameters before comparison
2024-01-15Add Pleroma.Support.Helpers.uri_query_sort/1 for easy sorting of a URL's ↵Mark Felder
query parameters
2024-01-15Merge branch 'mrf-regex-error' into 'develop'Haelwenn
MRF: Log sensible regex error for subdomain_match See merge request pleroma/pleroma!4026
2024-01-15Merge branch 'mrf-steal-emoji-extname' into 'develop'Haelwenn
MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing one See merge request pleroma/pleroma!4029
2024-01-14Allow the Remote Fetcher to attempt fetching an unreachable instancehandle_object_fetch_failuresMark Felder
2024-01-13Merge branch 'nil-contentMap' into 'develop'tusooa
Support objects with a nil contentMap (firefish) Closes #3231 See merge request pleroma/pleroma!4030
2024-01-11Add test to validate shared inboxes are used when multiple recipients from ↵use-shared-inbox-testMark Felder
the same instance are recipients
2024-01-11Support objects with a nil contentMap (firefish)Haelwenn (lanodan) Monnier
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3231
2024-01-07MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing oneHaelwenn (lanodan) Monnier
2024-01-07Fix testsEkaterina Vaartis
2024-01-02MRF: Log sensible error for subdomains_regexHaelwenn (lanodan) Monnier
2023-12-30LintingLain Soykaf
2023-12-29Revert grammar leak from bad mergeMark Felder
2023-12-29ConfigDB export to file does not have a consistent order.Mark Felder
Just test a few values to prove it was written
2023-12-29Fix regex string match due to OTP26 key order changeMark Felder
OTP25: "<http://localhost:4001/api/v1/favourites?limit=1&max_id=Ad1FhzPIS7gcHjUcoC&offset=0>; rel=\"next\"" OTP26: "<http://localhost:4001/api/v1/favourites?offset=0&limit=1&max_id=Ad1FmOIAXiSNgygflA>; rel=\"next\""
2023-12-29Fix Chat controller tests failing due to OTP26 key order changeMark Felder
2023-12-29Remove call to Pleroma.Web.Endpoint.config_change/2Mark Felder
This is not necessary for the tests to pass and breaks other tests as this change doesn't get cleanly reverted causing the hostname to stay set this way and leak into other test causing failures with "sub.example.com" not matching "localhost"
2023-12-29Fix test "transforms config to tuples"Mark Felder
This should have never worked. The default empty values for the other MRF Simple options will always be there.
2023-12-29Update Floki to get the :attributes_as_maps feature to allow us to compare ↵Mark Felder
equality of parsed documents without issues of key ordering
2023-12-29Implement a custom uri_equal?/2 to fix comparisons of URLs with unordered ↵Mark Felder
query parameters
2023-12-29Fix tests by leveraging Keyword.equal?/2Mark Felder
2023-12-29Merge branch 'publisher' into 'develop'Haelwenn
Discard some failed publisher jobs See merge request pleroma/pleroma!4022
2023-12-29Fix testsMark Felder
Need to handle the edge case of no valid HTTP response which has no status code
2023-12-29Merge branch 'bugfix/chat-attachment-empty-array' into 'develop'lain
ChatMessage: Tolerate attachment field set to an empty array Closes #3224 See merge request pleroma/pleroma!4020
2023-12-28Oban jobs should be discarded on permanent errorsMark Felder
2023-12-29ChatMessage: Tolerate attachment field set to an empty arrayHaelwenn (lanodan) Monnier
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3224
2023-12-28Remove reference to the :federation_publisher_modules setting in our config testMark Felder