Commit graph

6,533 commits

Author SHA1 Message Date
feld
ece089abab Merge branch 'improved-reachability' into 'develop'
Reachability refactor

See merge request pleroma/pleroma!4366
2025-07-29 21:13:48 +00:00
Mark Felder
28b69f5c04 Reset Emoji cache between tests
This fixes intermittent test failures
2025-07-22 15:21:20 -07:00
Mark Felder
113261146f Fix account endorsements test
Random failures were caused by the results sometimes being returned out of order.
2025-07-22 15:21:20 -07:00
Mark Felder
b54b19a0f4 Fix test for mix task
Missing assert_receive which would cause the test to randomly fail
2025-07-22 15:21:20 -07:00
Mark Felder
17987e3990 Enforce an exact domain match for WebFinger resolution
The regex was not being terminated with an $
2025-07-03 12:08:36 -07:00
Mark Felder
736686b4e2 Add specific tests for Webfinger aliases / also_known_as
Also reorganize similar tests to be grouped together
2025-07-03 11:19:52 -07:00
Mark Felder
122ad4603a Use correct Endpoint host and WebFinger domains in tests 2025-07-03 10:56:07 -07:00
Mark Felder
59844d0202 Rename Instance.delete_users_and_activities/1 to Instance.delete/1 2025-06-28 13:37:06 -07:00
Mark Felder
df0880d8d1 Add Instances.delete_all_unreachable/0 2025-06-28 13:23:37 -07:00
Mark Felder
29f7607910 Add Instances.check_all_unreachable/0 and Instance.check_unreachable/1 2025-06-28 12:51:10 -07:00
Mark Felder
2267ace106 Ensure ReachabilityWorker jobs can be scheduled without needing awareness of the phase design 2025-06-27 18:12:18 -07:00
Mark Felder
ff5f88aae3 Instance.set_reachable/1 should delete any existing ReachabilityWorker jobs for that instance 2025-06-27 18:07:46 -07:00
Mark Felder
77dca7c3e5 Refactor ReachabilityWorker to use a 5-phase reachability testing approach
It will check reachability for an instance deemed unreachable at the following intervals:

4 attempts, once a minute
4 attempts, once every 15 minutes
4 attempts, once every 60 minutes
4 attempts, once every 8 hours
4 attempts, once every 24 hours

This should be effective and respectful of the resources of instances on the fediverse.

We have the Oban Pruner plugin enabled to keep the Oban Jobs table from growing indefinitely. It prunes every 15 minutes, but this will interfere with our ability to enforce uniqueness on the ReachabilityWorker jobs for a time period longer than 15 minutes. The solution is to exclude the ReachabilityWorker from the pruning operation and instead schedule a custom job that will prune the table for us once a day. The ReachabilityPruner cron task will clean up the history of the ReachabilityWorker jobs older than 6 days.
2025-06-27 17:00:02 -07:00
Mark Felder
e58ecd3234 Merge remote-tracking branch 'origin/develop' into improved-reachability 2025-06-27 15:59:46 -07:00
feld
cf6587d344 Merge branch 'delete-instance-improvement' into 'develop'
Queue individual jobs for each user that needs to be deleted when deleting an instance.

See merge request pleroma/pleroma!4377
2025-06-27 20:25:41 +00:00
Mark Felder
ca616e9e73 Fix Instance and Admin API controller tests for deleting instances
Ensure the job was queued, remove the other test validation. We already prove elsewhere that Pleroma.User.delete/1 works, so repeating that here is a waste.
2025-06-27 12:14:17 -07:00
feld
f6c9b003fa Merge branch 'resurrect-mrf-quietreply' into 'develop'
Resurrect MRF.QuietReply

See merge request pleroma/pleroma!4368
2025-06-27 19:13:07 +00:00
Mark Felder
81155a2292 changelog for MRF.QuietReply 2025-06-27 11:26:27 -07:00
Mark Felder
56aab905e8 Queue individual jobs for each user that needs to be deleted when deleting an instance. 2025-06-27 11:13:15 -07:00
vaartis
9be542e272 Merge branch 'handle-dislike' into 'develop'
Handle the Dislike activity by transforming into a thumbs-down emote

Closes #3378

See merge request pleroma/pleroma!4369
2025-06-21 14:18:46 +00:00
Mark Felder
37d4ed883c Change MRF logic to match when there is an inReplyTo and the public address is in the "to" field
Update the method to alter the to/cc fields for consistency and modify the tests to work without requiring a specific order items in the list
2025-06-19 14:50:45 -07:00
vaartis
cda7cbf2a1 Merge branch 'scrobbles' into 'develop'
Change ScrobbleView external link param name to use snake case

See merge request pleroma/pleroma!4243
2025-06-18 10:25:38 +00:00
Ekaterina Vaartis
7ecfb95331 Handle the Dislike activity by transforming into a thumbs-down emote 2025-06-16 14:18:15 +03:00
Haelwenn (lanodan) Monnier
a69e417020
File.mkdir_p -> Pleroma.Backports.mkdir_p 2025-06-16 12:48:47 +02:00
lain
bc75bb35fa Merge branch 'relaxed-also-known-as' into 'develop'
Relax alsoKnownAs requirements to just being a URI

See merge request pleroma/pleroma!4367
2025-06-14 08:30:13 +00:00
Mark Felder
33cf49e860 Resurrect MRF.QuietReply
This was not working correctly because the Publisher was stripping the public address from the cc when federating unlisted activities
2025-06-13 10:28:21 -07:00
Mark Felder
fe6d2ecc97 Test for unlisted but Publisher param_cc is not empty 2025-06-12 22:41:39 -07:00
Mark Felder
d3adc3e05e Split this cc test into two individual cases 2025-06-12 21:59:37 -07:00
Mark Felder
9f79df7508 Add test demonstrating public getting stripped from unlisted activity CC 2025-06-12 21:32:43 -07:00
Mark Felder
27ec46814c Revert "Public getting stripped from unlisted activity CC: Add possible tests"
This reverts commit ded40182b0.
2025-06-12 21:27:19 -07:00
Mark Felder
8488362248 Merge remote-tracking branch 'origin/develop' into unlisted-fix 2025-06-12 21:20:34 -07:00
Ekaterina Vaartis
a361b84fc9 Relax alsoKnownAs requirements to just being a URI 2025-06-11 23:24:18 +03:00
Mark Felder
3d422ef325 Reachability refactor
The result of Oban jobs determine the reachability status.

Publisher jobs will cancel themselves at execution time if the target server is now unreachable.

Receiving activities does not immediately mark a server as reachable, but creates a ReachabilityWorker job to validate.

A Cron will execute daily to test all unreachable servers.
2025-06-06 12:32:09 -07:00
Mark Felder
a2ad2d8d23 Remove unused import 2025-06-05 16:54:05 -07:00
vaartis
8484e09424 Merge branch 'elixir-1.18' into 'develop'
Elixir 1.18 warnings

See merge request pleroma/pleroma!4358
2025-06-05 09:00:39 +00:00
Phantasm
dc26f74961
Revert to previous tag_validator behavior
This paritally reverts commit 9710063fdc
and reverts commit 7ddae61414

See thread: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112761
2025-06-04 19:16:59 +02:00
Ekaterina Vaartis
7ddae61414 Change the test that assumes that a hashtag with # will remain as-is
This does not seem to be the intended behaviour, as the code that produces it
did not actually ever do anything and just returned the tag as-is.

See
lib/pleroma/web/activity_pub/object_validators/tag_validator.ex
and
https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112681

At least Mastodon and Misskey output tags without the # from their API,
so in reality tags with the hash should rarely happen.
2025-06-04 12:28:59 +03:00
Ekaterina Vaartis
d95e1066b9 Fix formatting 2025-06-04 12:03:54 +03:00
Phantasm
1be8deda73
Remove Pleroma.OTPVersion module
Its last use was a check in lib/application.ex that was removed in
commit 0e53cb4940

Major OTP version can be fetched with System.otp_release/0.
If checking against minor versions and patch levels is needed,
revert this commit since it uses the recommended way of getting
a full OTP version string.
2025-06-03 23:17:39 +02:00
lain
93ce56418e Merge branch 'permissive-webfinger' into 'develop'
WebFinger query default to return JSON when no or unrecognized accept header is provided.

Closes #3381

See merge request pleroma/pleroma!4345
2025-05-29 08:41:27 +00:00
Phantasm
7c13abb3d9
Elixir 1.18 Use NaiveDateTime.compare/2 instead of <>= comparisons
warning: comparison with structs found:

        left <= right

    given types:

        dynamic() <= dynamic(%NaiveDateTime{})

    where "left" (context ExUnit.Assertions) was given the type:

        # type: dynamic()
        # from: test/pleroma/web/plugs/user_tracking_plug_test.exs:25
        left = user.last_active_at

    where "right" (context ExUnit.Assertions) was given the type:

        # type: dynamic(%NaiveDateTime{})
        # from: test/pleroma/web/plugs/user_tracking_plug_test.exs:25
        right = NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)

    Comparison operators (>, <, >=, <=, min, and max) perform structural and not semantic comparison. Comparing with a struct won't give meaningful results. Structs that can be compared typically define a compare/2 function within their modules that can be used for semantic comparison.

    typing violation found at:
    │
 25 │     assert user.last_active_at <= NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
    │                                ~
    │
    └─ test/pleroma/web/plugs/user_tracking_plug_test.exs:25:32: Pleroma.Web.Plugs.UserTrackingPlugTest."test updates last_active_at for a new user"/1
2025-05-14 16:37:43 +02:00
Phantasm
5addbf39fb
Elixir 1.18 Deal with :warnings_as_errors deprecation in compiler_options/1
warning: :warnings_as_errors is deprecated as part of Code.get_compiler_option/1
  (elixir 1.18.3) lib/code.ex:1597: Code.get_compiler_option/1
  (elixir 1.18.3) lib/code.ex:1572: anonymous fn/2 in Code.compiler_options/1
  (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
  (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1
  (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2
  (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4

warning: :warnings_as_errors is deprecated as part of Code.put_compiler_option/2, instead you must pass it as a --warnings-as-errors flag. If you need to set it as a default in a mix task, you can also set it under aliases: [compile: "compile --warnings-as-errors"]
  (elixir 1.18.3) lib/code.ex:1710: Code.put_compiler_option/2
  (elixir 1.18.3) lib/code.ex:1573: anonymous fn/2 in Code.compiler_options/1
  (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
  (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1
  (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2
  (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4
2025-05-13 14:02:47 +02:00
Lain Soykaf
ded40182b0 Public getting stripped from unlisted activity CC: Add possible tests 2025-05-05 15:48:34 +04:00
Ekaterina Vaartis
51a0cee405 Add expiring blocks
- `/api/v1/accounts/:id/block` now has a "duration" parameter
- `/api/v1/blocks` returns "block_expires_at" to indicate when the block
will expire
- MuteExpireWorker also processes block expiration
- Remove unused OpenAPI parameters from mute endpoint
- Add pleroma:block_expiration to nodeinfo features
2025-04-15 12:55:09 +03:00
lain
1775a4db08 Merge branch 'siteinfo-baseurls' into 'develop'
Provide media proxy and upload base urls in siteinfo

See merge request pleroma/pleroma!4349
2025-04-02 13:00:42 +00:00
Moon Man
93aa563cfe implemented 2025-04-02 07:00:45 -04:00
Nicole Mikołajczyk
4d4174c339 fix a few typos
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-03-28 18:47:00 +01:00
Moon Man
43a124bb14 formatting 2025-03-20 12:51:43 -04:00
Moon Man
7624af92cf tests for webfinger 2025-03-20 12:46:03 -04:00
lain
254b31bf1c Merge branch 'more-emoji-likes' into 'develop'
More emoji likes

Closes #3364

See merge request pleroma/pleroma!4342
2025-03-20 09:12:09 +00:00