pleroma issueshttps://git.pleroma.social/pleroma/pleroma/-/issues2024-02-06T05:38:59Zhttps://git.pleroma.social/pleroma/pleroma/-/issues/3235E-mail sending fails with exception2024-02-06T05:38:59ZlewdthewidesE-mail sending fails with exception<!--
### Precheck
* For support use https://git.pleroma.social/pleroma/pleroma-support or [community channels](https://git.pleroma.social/pleroma/pleroma#community-channels).
* Please do a quick search to ensure no similar bug has been ...<!--
### Precheck
* For support use https://git.pleroma.social/pleroma/pleroma-support or [community channels](https://git.pleroma.social/pleroma/pleroma#community-channels).
* Please do a quick search to ensure no similar bug has been reported before. If the bug has not been addressed after 2 weeks, it's fine to bump it.
* Try to ensure that the bug is actually related to the Pleroma backend. For example, if a bug happens in Pleroma-FE but not in Mastodon-FE or mobile clients, it's likely that the bug should be filed in [Pleroma-FE](https://git.pleroma.social/pleroma/pleroma-fe/issues/new) repository.
-->
### Environment
* Installation type (OTP or From Source): _Source_
* Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): _2.6.51-528-g251c455b-develop_
* Elixir version (`elixir -v` for from source installations, N/A for OTP): _1.14.0_
* Operating system: _Arch Linux_
* PostgreSQL version (`psql -V`): _16.1_
### Bug description
E-mails are not being sent out anymore for events such as receiving reports. An exception is thrown when I try to send a test e-mail:
```
[root@Wides-PL pleroma]# pleroma mix pleroma.email test --to "test-74224f@test.mailgenius.com"
** (EXIT from #PID<0.101.0>) shutdown: failed to start child: Pleroma.Config.TransferTask
** (EXIT) an exception was raised:
** (ArgumentError) errors were found at the given arguments:
* 1st argument: not an already existing atom
:erlang.binary_to_existing_atom("Elixir.Pleroma.Web.Endpoint.MetricsExporter", :utf8)
(pleroma 2.6.51-583-g3b9d9915-develop) lib/pleroma/config_db.ex:345: Pleroma.ConfigDB.string_to_elixir_types/1
(pleroma 2.6.51-583-g3b9d9915-develop) lib/pleroma/ecto_type/config/atom.ex:21: Pleroma.EctoType.Config.Atom.load/1
(ecto 3.11.1) lib/ecto/type.ex:935: Ecto.Type.process_loaders/3
(ecto 3.11.1) lib/ecto/repo/queryable.ex:423: Ecto.Repo.Queryable.struct_load!/6
(ecto 3.11.1) lib/ecto/repo/queryable.ex:246: anonymous fn/5 in Ecto.Repo.Queryable.preprocessor/3
(elixir 1.14.0) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.14.0) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
```
This is almost the exact same error as https://git.pleroma.social/pleroma/pleroma/-/issues/3223, which I'm also affected byhttps://git.pleroma.social/pleroma/pleroma/-/issues/3233can't follow castopod podcast2024-02-06T05:39:54ZLuca Sironican't follow castopod podcastHello,
castopod accounts are discoverable from pleroma but, whenever you try to follow them, the request stay stucked in sent.
From mastodon it does work.
Can you investigate ?
You can pick whatever account@instance from
https://index....Hello,
castopod accounts are discoverable from pleroma but, whenever you try to follow them, the request stay stucked in sent.
From mastodon it does work.
Can you investigate ?
You can pick whatever account@instance from
https://index.castopod.org/https://git.pleroma.social/pleroma/pleroma/-/issues/3230No notification end of polls2024-03-26T18:34:08ZBen HikerNo notification end of pollsIn my configuration I have set "notification at end of polls" where I voted. But this notification never shows up in the column "notifications". The poll are made on a Firefish or Mastodon platform.In my configuration I have set "notification at end of polls" where I voted. But this notification never shows up in the column "notifications". The poll are made on a Firefish or Mastodon platform.https://git.pleroma.social/pleroma/pleroma/-/issues/3229Invalid hashtag causes the whole post to be dropped2024-02-07T16:31:32ZtusooaInvalid hashtag causes the whole post to be droppedhttps://stelpolva.moe/notes/9o548dtfkochwfox contains `test-hashtag`, causing the whole post to be dropped from pleroma. We should only drop the hashtag that does not pass our validation rules, not the whole post.https://stelpolva.moe/notes/9o548dtfkochwfox contains `test-hashtag`, causing the whole post to be dropped from pleroma. We should only drop the hashtag that does not pass our validation rules, not the whole post.https://git.pleroma.social/pleroma/pleroma/-/issues/3228Develop compilation failed2024-02-06T05:40:18ZBen HikerDevelop compilation failedRecent develop version fails in compilation
== Compilation error in file lib/vix/vips/enum.ex ==
** (UndefinedFunctionError) function Vix.Nif.nif_vips_enum_list/0 is undefined (module Vix.Nif is not available)
Vix.Nif.nif_vips_enum_...Recent develop version fails in compilation
== Compilation error in file lib/vix/vips/enum.ex ==
** (UndefinedFunctionError) function Vix.Nif.nif_vips_enum_list/0 is undefined (module Vix.Nif is not available)
Vix.Nif.nif_vips_enum_list()
lib/vix/vips/enum.ex:5: Vix.Vips.EnumHelper.__before_compile__/1
(stdlib 4.3.1.3) lists.erl:1350: :lists.foldl/3
(stdlib 4.3.1.3) lists.erl:1355: :lists.foldl_1/3https://git.pleroma.social/pleroma/pleroma/-/issues/3227Internal nickname format checking is ignored when remote clashing nicknames a...2024-02-06T05:40:38ZPhantasmInternal nickname format checking is ignored when remote clashing nicknames are handled<!--
### Precheck
* For support use https://git.pleroma.social/pleroma/pleroma-support or [community channels](https://git.pleroma.social/pleroma/pleroma#community-channels).
* Please do a quick search to ensure no similar bug has been ...<!--
### Precheck
* For support use https://git.pleroma.social/pleroma/pleroma-support or [community channels](https://git.pleroma.social/pleroma/pleroma#community-channels).
* Please do a quick search to ensure no similar bug has been reported before. If the bug has not been addressed after 2 weeks, it's fine to bump it.
* Try to ensure that the bug is actually related to the Pleroma backend. For example, if a bug happens in Pleroma-FE but not in Mastodon-FE or mobile clients, it's likely that the bug should be filed in [Pleroma-FE](https://git.pleroma.social/pleroma/pleroma-fe/issues/new) repository.
-->
### Environment
* Installation type (OTP or From Source): Source
* Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): [2.6.0-fluffytail](https://git.fluffytail.org/phnt/pleroma/src/branch/fluffytail) and current develop commit f74f5e0a56277507e7bc3df7251ec58b6c8b41cb
* Elixir version (`elixir -v` for from source installations, N/A for OTP): 1.16.0
* Operating system: Arch Linux
* PostgreSQL version (`psql -V`): 16.1
### Bug description
When Pleroma backend encounters a remote clashing nickname with a different ap_id in function [`maybe_handle_clashing_nickname`](https://git.pleroma.social/pleroma/pleroma/-/blob/develop/lib/pleroma/web/activity_pub/activity_pub.ex#L1737), it adds a dot to the nickname and renames it. This misses internal nickname format checking enforced by the [`local_nickname_regex`](https://git.pleroma.social/pleroma/pleroma/-/blob/develop/lib/pleroma/user.ex#L57) and Pleroma doesn't expect this. The `local_nickname_regex` is only used for local users, but some parts of the backend probably rely on this behavior even for remote users thus creating this bug.
If I try to create a username with a dot inside it, as is done by Pleroma in the above function `maybe_handle_clashing_nickname`, it will fail with an Ecto.changeset error (in `validate_format` in ecto to be precise) as shown [here](https://upload.fluffytail.org/media/743212f2f661aa7ea3826d68f46fd0c6d884c4de989788d46721bf4d32e4eaa6.png?name=screenshot-20240104-001048-82.png). Adding a dot to the above regex is enough for Pleroma to create the account and the account mostly works (see my screenshots in the related thread).
As a result from this behavior, that user cannot be tagged in any posts and the handle isn't properly displayed in the frontend.
### Summary
* clashing nicknames with different ap_id miss internal nickname checking
* the affected user cannot be tagged in any posts
* handles are improperly displayed in the frontend
Related thread with screenshots: https://fluffytail.org/notice/AdTquInU8oJeZ9Qp9chttps://git.pleroma.social/pleroma/pleroma/-/issues/3225Certain pages keep showing up in fedi-fe even after I deleted fedi-fe2024-02-06T05:40:51ZJSCertain pages keep showing up in fedi-fe even after I deleted fedi-fe# Environment info
<!-- Everything is optional and where applicable but the more information the better. -->
* Client browser, version, OS, platform: Firefox 122, Windows
* Server OS, platform: Raspbian 12 (bookwork), Raspberry Pi 3B
* ...# Environment info
<!-- Everything is optional and where applicable but the more information the better. -->
* Client browser, version, OS, platform: Firefox 122, Windows
* Server OS, platform: Raspbian 12 (bookwork), Raspberry Pi 3B
* Frontend version (see settings -> about): latest as of 12/31/2023 (not shown in settings > about)
* Backend version (see settings -> about): latest as of 12/31/2023 (not shown in settings > about)
* Browser extensions (ublock, rikaichamp etc): ublock
* Known instance/user customizations (i.e. pleromafe mods/forks, instance styles etc)
# Bug description & reproduction steps
<!-- Type out here how to reproduce the bug, what goes wrong and what should go right -->
## Setup:
1. Set up a fresh Pleroma instance
2. Go to the admin panel
3. Install the latest version of the fedi-fe frontend
4. Set it as default frontend (not sure if this has anything to do with it)
5. Log into fedi-fe (not sure if this is part of the bug)
6. Log out of fedi-fe (not sure if this is part of the bug)
7. Revert the default frontend to `pleroma-fe`
8. Delete fedi-fe (`sudo -Hu pleroma rm -rf /opt/pleroma/instance/static/frontends/fedi-fe`)
9. Restart the Pleroma instance for good measure (`sudo service pleroma restart`)
## Repro 1:
1. Be logged into your instance. The active frontend should be pleroma-fe as expected.
2. Go to your timeline (`/main/friends`)
3. Click on a user's @handle (not the name, that doesn't work); it should point to `/users/$xxx`
![pleroma01](/uploads/68396c33ecf9180471084a74ad266bc4/pleroma01.jpg)
4. Your browser is now at `/users/$xxx` and the user's profile is shown as normal
5. Now reload the page
6. Result: now you're still at `/users/$xxx`, but the frontend has reverted to fedi-fe and the profile cannot be displayed
![pleroma02](/uploads/cbcabff17269281da4e925466f391beb/pleroma02.jpg)
## Repro 2:
1. Be logged into your instance. The active frontend should be pleroma-fe as expected.
2. Go to your timeline (`/main/friends`)
3. Right click on a user's @handle (not the name); it should point to `/users/$xxx`
4. Select "Open in new tab"
5.
![pleroma03](/uploads/420171510d9d7d93ce60f8e98847b6f3/pleroma03.jpg)
5. Result: `/users/$xxx` is open in a new tab, but this tab uses fedi-fe instead of pleroma-fe. The profile cannot be displayed.
![pleroma02](/uploads/789c0be00088ed9270841a9237ab5e04/pleroma02.jpg)
The only relevant console error is:
![image](/uploads/6a09680e55d4914e1e8b1d7b077556ab/image.png)
# Bug seriousness
<!-- Everything is optional and free-form -->
* How annoying it is: very
* How often does it happen: every time
* How many people does it affect: unknown
* Is there a workaround for it: I wish I knewhttps://git.pleroma.social/pleroma/pleroma/-/issues/3223Broken MRF section in Admin FE, can't dump config via cli2024-03-27T15:32:11ZDmytro PoltavchenkoBroken MRF section in Admin FE, can't dump config via cliHello,
Somewhere after commit 4c5b45ed7, a bug was introduced that breaks MRF Policies.
![image](/uploads/c73f2a85515305e644e18119dbea7f0d/image.png)
I tried to dump the config via CLI but received the following error:
```
# docker-co...Hello,
Somewhere after commit 4c5b45ed7, a bug was introduced that breaks MRF Policies.
![image](/uploads/c73f2a85515305e644e18119dbea7f0d/image.png)
I tried to dump the config via CLI but received the following error:
```
# docker-compose run --rm web mix pleroma.config dump pleroma
Creating pleroma_web_run ... done
** (EXIT from #PID<0.94.0>) shutdown: failed to start child: Pleroma.Config.TransferTask
** (EXIT) an exception was raised:
** (ArgumentError) errors were found at the given arguments:
* 1st argument: not an already existing atom
:erlang.binary_to_existing_atom("Elixir.Pleroma.Web.Endpoint.MetricsExporter", :utf8)
(pleroma 2.6.50-266-g7622a839) lib/pleroma/config_db.ex:345: Pleroma.ConfigDB.string_to_elixir_types/1
(pleroma 2.6.50-266-g7622a839) lib/pleroma/ecto_type/config/atom.ex:21: Pleroma.EctoType.Config.Atom.load/1
(ecto 3.10.3) lib/ecto/type.ex:911: Ecto.Type.process_loaders/3
(ecto 3.10.3) lib/ecto/repo/queryable.ex:411: Ecto.Repo.Queryable.struct_load!/6
(ecto 3.10.3) lib/ecto/repo/queryable.ex:243: anonymous fn/5 in Ecto.Repo.Queryable.preprocessor/3
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
ERROR: 1
```https://git.pleroma.social/pleroma/pleroma/-/issues/32224xx responses from a web push server instantly deletes the subscription2024-02-06T05:42:40Zfeld4xx responses from a web push server instantly deletes the subscriptionIf there's a configuration error or any other problem with the push server we just delete the subscription and the user has no feedback about it. There's no way to recover from it except to log out from the app and log back in.
How shou...If there's a configuration error or any other problem with the push server we just delete the subscription and the user has no feedback about it. There's no way to recover from it except to log out from the app and log back in.
How should we approach this?
Soft disable? Keep a count of failures? Ignore them completely?
```
def push_message(body, sub, api_key, subscription) do
case WebPushEncryption.send_web_push(body, sub, api_key) do
{:ok, %{status: code}} when code in 400..499 ->
Logger.debug("Removing subscription record")
Repo.delete!(subscription)
:ok
```lainlainhttps://git.pleroma.social/pleroma/pleroma/-/issues/3221Pleroma v2.6.0+ Broken Conversations with Misskey Users2024-02-06T05:42:03ZFWC 9696Pleroma v2.6.0+ Broken Conversations with Misskey Users### Precheck
This issue was almost certainly introduced in Pleroma v2.6.0 on OTP. The issue is present across all frontends, so it is a Pleroma Backend issue.
### Environment
* Installation type (OTP or From Source): OTP
* Pleroma ver...### Precheck
This issue was almost certainly introduced in Pleroma v2.6.0 on OTP. The issue is present across all frontends, so it is a Pleroma Backend issue.
### Environment
* Installation type (OTP or From Source): OTP
* Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 2.6.0 and greater (issue persists on 2.6.1)
* Elixir version (`elixir -v` for from source installations, N/A for OTP): N/A
* Operating system: Ubuntu 23.10.1
* PostgreSQL version (`psql -V`): 15.5
### Bug description
When a Misskey user replies to a post, the reply and the replied-to post are both available on the server, but the conversation view will not load the entire conversation. Instead, the conversation view only loads the Misskey user's posts.
Here is an example of the issue occurring on my instance: https://5dollah.click/notice/Acu7SPVdpjNd8Y0C5w
Here is the same issue occuring on Soapbox-FE: https://soapbox.5dollah.click/@40@den.raccoon.quest/posts/Acu7SPVdpjNd8Y0C5w
Note that the replied-to post is available and can be accessed through the "reply to" flag on Pleroma-FE, but the conversation view never loads properly on any frontend (this also applies to pressing the "+" next to a post in Pleroma-FE's timelines.)
I believe that the bug was introduced as a result of the following item in the patchnotes of Pleroma v2.6.0:
>ForceMentionsInContent: fix double mentions for Mastodon/Misskey postshttps://git.pleroma.social/pleroma/pleroma/-/issues/3218Slow notifications when instance blocking2024-03-13T13:12:48ZMatthieu RakotojaonaSlow notifications when instance blockingFirst of all, thanks a lot for Pleroma ! It's nice being able to run an ActivityPub software that doesn't eat all your resources and actually speaks the protocol.
### Environment
* Installation type (OTP or From Source): yunohost, so I...First of all, thanks a lot for Pleroma ! It's nice being able to run an ActivityPub software that doesn't eat all your resources and actually speaks the protocol.
### Environment
* Installation type (OTP or From Source): yunohost, so I guess it's a OPT install
* Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): 255
* Elixir version (`elixir -v` for from source installations, N/A for OTP): N/A
* Operating system: Debian
* PostgreSQL version (`psql -V`): Debian 13.13
### Warning
I think it's ok to put my own id, but there's also some accounts/instances that I block, for a good reason (racist stuff). I advise not checking them out.
### Bug description
I've been having slow (5-10s) notifications for a few weeks now, so I started investigating and it seems to be the database.
After setting the logs to :debug here's the relevant section:
```
ec 12 16:11:18 rako.space pleroma[2268146]: 16:11:18.737 request_id=F6AheyPiJNo6PgUA_B2x [debug] QUERY OK source="notifications" db=6815.4ms queue=0.4ms idle=1556.1ms
Dec 12 16:11:18 rako.space pleroma[2268146]: SELECT n0."id", n0."seen", n0."type", n0."user_id", n0."activity_id", n0."inserted_at", n0."updated_at", a1."id", a1."data", a1."local", a1."actor", a1."recipients", a1."inserted_at", a1."updated_at", o2."id", o2."data", o2."inserted_at", o2."updated_at" FROM "notifications" AS n0 INNER JOIN "activities" AS a1 ON a1."id" = n0."activity_id" LEFT OUTER JOIN "objects" AS o2 ON (o2."data"->>'id') = associated_object_id(a1."data") INNER JOIN "users" AS u3 ON u3."ap_id" = a1."actor" LEFT OUTER JOIN "thread_mutes" AS t4 ON (t4."user_id" = $1) AND (t4."context" = a1."data"->>'context') WHERE (n0."user_id" = $2) AND (u3."is_active") AND (NOT (a1."actor" = ANY($3))) AND (t4."user_id" IS NULL) AND (NOT (a1."actor" = ANY($4))) AND (NOT (substring(a1."actor" from '.*://([^/]*)') = ANY($5)) OR
Dec 12 16:11:18 rako.space pleroma[2268146]: a1."actor" = ANY(SELECT ap_id FROM users AS u INNER JOIN following_relationships AS fr
Dec 12 16:11:18 rako.space pleroma[2268146]: ON u.id = fr.following_id WHERE fr.follower_id = $6 AND fr.state = $7)
Dec 12 16:11:18 rako.space pleroma[2268146]: ) AND (n0."type" = ANY($8)) ORDER BY n0."id" desc nulls last LIMIT $9 ["ADVMFpVkzRniZTxHqC", "ADVMFpVkzRniZTxHqC", [], ["https://toot.community/users/pmroman", "https://pieville.net/users/charliebrownau"], ["pieville.net"], <<0, 0, 1, 125, 47, 220, 171, 120, 78, 29, 208, 24, 89, 222, 0, 0>>, 2, ["mention", "follow", "follow_request", "reblog", "favourite", "move", "pleroma:emoji_reaction", "poll", "update"], 20]
```
Which, reordered and with fields filled in, gives this (I assume the binary list is my id, because I don't know how to turn it into an id):
```
SELECT
n0."id",
n0."seen",
n0."type",
n0."user_id",
n0."activity_id",
n0."inserted_at",
n0."updated_at",
a1."id",
a1."data",
a1."local",
a1."actor",
a1."recipients",
a1."inserted_at",
a1."updated_at",
o2."id",
o2."data",
o2."inserted_at",
o2."updated_at"
FROM
"notifications" AS n0
INNER JOIN "activities" AS a1 ON a1."id" = n0."activity_id"
LEFT OUTER JOIN "objects" AS o2 ON (o2."data" ->> 'id') = associated_object_id(a1."data")
INNER JOIN "users" AS u3 ON u3."ap_id" = a1."actor"
LEFT OUTER JOIN "thread_mutes" AS t4 ON (t4."user_id" = '0000017d-2fdc-ab78-4e1d-d01859de0000')
AND (
t4."context" = a1."data" ->> 'context'
)
WHERE
(n0."user_id" = '0000017d-2fdc-ab78-4e1d-d01859de0000')
AND (u3."is_active")
AND (
NOT (
a1."actor" = ANY(ARRAY[''::text])
)
)
AND (t4."user_id" IS NULL)
AND (
NOT (
a1."actor" = ANY(ARRAY['https://toot.community/users/pmroman', 'https://pieville.net/users/charliebrownau'])
)
)
AND (
NOT (
substring(
a1."actor"
from
'.*://([^/]*)'
) = ANY(ARRAY['pieville.net'])
)
OR a1."actor" = ANY(
SELECT
ap_id
FROM
users AS u
INNER JOIN following_relationships AS fr ON u.id = fr.following_id
WHERE
fr.follower_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'
AND fr.state = 2
)
)
AND (
n0."type" = ANY(ARRAY['mention'::notification_type, 'follow'::notification_type, 'follow_request'::notification_type, 'reblog'::notification_type, 'favourite'::notification_type, 'move'::notification_type, 'pleroma:emoji_reaction'::notification_type, 'poll'::notification_type, 'update'])
)
ORDER BY
n0."id" desc nulls last
LIMIT
20;
```
When run in my db it is indeed slow, here is the EXPLAIN ANALYZE VERBOSE of it:
```
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=127134.34..127134.39 rows=20 width=2051) (actual time=7208.379..7208.388 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
-> Sort (cost=127134.34..127135.50 rows=465 width=2051) (actual time=7123.124..7123.131 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
Sort Key: n0.id DESC NULLS LAST
Sort Method: top-N heapsort Memory: 161kB
-> Nested Loop Anti Join (cost=2663.89..127121.96 rows=465 width=2051) (actual time=4.663..7116.180 rows=2670 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
Join Filter: ((t4.context)::text = (a1.data ->> 'context'::text))
-> Nested Loop Left Join (cost=2663.75..127105.66 rows=465 width=2051) (actual time=4.651..7112.875 rows=2670 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
Inner Unique: true
-> Nested Loop (cost=2662.95..126472.83 rows=465 width=750) (actual time=3.593..6999.082 rows=2670 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at
Inner Unique: true
-> Hash Join (cost=2662.52..125300.95 rows=1828 width=750) (actual time=3.511..6921.999 rows=2676 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at
Hash Cond: (a1.id = n0.activity_id)
-> Seq Scan on public.activities a1 (cost=2532.70..121191.40 rows=1056385 width=689) (actual time=0.177..6600.496 rows=1055736 loops=1)
Output: a1.id, a1.data, a1.inserted_at, a1.updated_at, a1.local, a1.actor, a1.recipients
Filter: (((a1.actor)::text <> ALL ('{""}'::text[])) AND ((a1.actor)::text <> ALL ('{https://toot.community/users/pmroman,https://pieville.net/users/charliebrownau}'::text[])) AND (("substring"((a1.actor)::text, '.*://([^/]*)'::text) <> ALL ('{pieville.net}'::text[])) OR (hashed SubPlan 1)))
Rows Removed by Filter: 9
SubPlan 1
-> Nested Loop (cost=0.42..2531.92 rows=313 width=38) (never executed)
Output: u.ap_id
Inner Unique: true
-> Seq Scan on public.following_relationships fr (cost=0.00..14.20 rows=313 width=16) (never executed)
Output: fr.id, fr.follower_id, fr.following_id, fr.state, fr.inserted_at, fr.updated_at
Filter: ((fr.follower_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'::uuid) AND (fr.state = 2))
-> Index Scan using users_pkey on public.users u (cost=0.42..8.04 rows=1 width=54) (never executed)
Output: u.ap_id, u.id
Index Cond: (u.id = fr.following_id)
-> Hash (cost=106.91..106.91 rows=1833 width=61) (actual time=2.733..2.734 rows=2677 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at
Buckets: 4096 (originally 2048) Batches: 1 (originally 1) Memory Usage: 283kB
-> Seq Scan on public.notifications n0 (cost=0.00..106.91 rows=1833 width=61) (actual time=0.028..1.404 rows=2677 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at
Filter: ((n0.user_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'::uuid) AND (n0.type = ANY ('{mention,follow,follow_request,reblog,favourite,move,pleroma:emoji_reaction,poll,update}'::notification_type[])))
Rows Removed by Filter: 92
-> Index Scan using users_ap_id_index on public.users u3 (cost=0.42..0.64 rows=1 width=38) (actual time=0.026..0.026 rows=1 loops=2676)
Output: u3.ap_id
Index Cond: ((u3.ap_id)::text = (a1.actor)::text)
Filter: u3.is_active
Rows Removed by Filter: 0
-> Index Scan using objects_unique_apid_index on public.objects o2 (cost=0.80..1.36 rows=1 width=1301) (actual time=0.027..0.027 rows=1 loops=2670)
Output: o2.id, o2.data, o2.inserted_at, o2.updated_at
Index Cond: ((o2.data ->> 'id'::text) = (associated_object_id(a1.data))::text)
-> Materialize (cost=0.14..8.17 rows=1 width=516) (actual time=0.000..0.000 rows=0 loops=2670)
Output: t4.context
-> Index Only Scan using unique_index on public.thread_mutes t4 (cost=0.14..8.16 rows=1 width=516) (actual time=0.006..0.006 rows=0 loops=1)
Output: t4.context
Index Cond: (t4.user_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'::uuid)
Heap Fetches: 0
Planning Time: 38.492 ms
JIT:
Functions: 49
Options: Inlining false, Optimization false, Expressions true, Deforming true
Timing: Generation 36.191 ms, Inlining 0.000 ms, Optimization 2.982 ms, Emission 81.449 ms, Total 120.623 ms
Execution Time: 7386.114 ms
(59 rows)
```
I tried to hack around and I see it's this specific part that makes the whole thing crawl to a slow:
```
OR a1."actor" = ANY(
SELECT
ap_id
FROM
users AS u
INNER JOIN following_relationships AS fr ON u.id = fr.following_id
WHERE
fr.follower_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'
AND fr.state = 2
)
```
When I remove it and run it, it is fast again. Here's the EXPLAIN ANALYZE VERBOSE:
```
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=2.07..705.06 rows=20 width=2051) (actual time=0.239..2.793 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
-> Nested Loop Anti Join (cost=2.07..16311.38 rows=464 width=2051) (actual time=0.237..2.784 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
Join Filter: ((t4.context)::text = (a1.data ->> 'context'::text))
-> Nested Loop Left Join (cost=1.93..16295.10 rows=464 width=2051) (actual time=0.229..2.755 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at, o2.id, o2.data, o2.inserted_at, o2.updated_at
Inner Unique: true
-> Nested Loop (cost=1.13..15663.00 rows=464 width=750) (actual time=0.118..1.300 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at
Inner Unique: true
-> Nested Loop (cost=0.71..14492.76 rows=1824 width=750) (actual time=0.085..0.747 rows=20 loops=1)
Output: n0.id, n0.seen, n0.type, n0.user_id, n0.activity_id, n0.inserted_at, n0.updated_at, a1.id, a1.data, a1.local, a1.actor, a1.recipients, a1.inserted_at, a1.updated_at
Inner Unique: true
-> Index Scan using notifications_id_desc_nulls_last_index on public.notifications n0 (cost=0.28..259.33 rows=1833 width=61) (actual time=0.024..0.061 rows=20 loops=1)
Output: n0.id, n0.user_id, n0.activity_id, n0.seen, n0.inserted_at, n0.updated_at, n0.type
Filter: ((n0.user_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'::uuid) AND (n0.type = ANY ('{mention,follow,follow_request,reblog,favourite,move,pleroma:emoji_reaction,poll,update}'::notification_type[])))
Rows Removed by Filter: 1
-> Index Scan using activities_pkey on public.activities a1 (cost=0.43..7.77 rows=1 width=689) (actual time=0.032..0.032 rows=1 loops=20)
Output: a1.id, a1.data, a1.inserted_at, a1.updated_at, a1.local, a1.actor, a1.recipients
Index Cond: (a1.id = n0.activity_id)
Filter: (((a1.actor)::text <> ALL ('{""}'::text[])) AND ((a1.actor)::text <> ALL ('{https://toot.community/users/pmroman,https://pieville.net/users/charliebrownau}'::text[])) AND ("substring"((a1.actor)::text, '.*://([^/]*)'::text) <> ALL ('{pieville.net}'::text[])))
-> Index Scan using users_ap_id_index on public.users u3 (cost=0.42..0.64 rows=1 width=38) (actual time=0.026..0.026 rows=1 loops=20)
Output: u3.ap_id
Index Cond: ((u3.ap_id)::text = (a1.actor)::text)
Filter: u3.is_active
-> Index Scan using objects_unique_apid_index on public.objects o2 (cost=0.80..1.36 rows=1 width=1301) (actual time=0.054..0.054 rows=1 loops=20)
Output: o2.id, o2.data, o2.inserted_at, o2.updated_at
Index Cond: ((o2.data ->> 'id'::text) = (associated_object_id(a1.data))::text)
-> Materialize (cost=0.14..8.17 rows=1 width=516) (actual time=0.001..0.001 rows=0 loops=20)
Output: t4.context
-> Index Only Scan using unique_index on public.thread_mutes t4 (cost=0.14..8.16 rows=1 width=516) (actual time=0.004..0.004 rows=0 loops=1)
Output: t4.context
Index Cond: (t4.user_id = '0000017d-2fdc-ab78-4e1d-d01859de0000'::uuid)
Heap Fetches: 0
Planning Time: 3.238 ms
Execution Time: 2.903 ms
(37 rows)
```
I don't know enough about the project and Elixir to be able to fix it myself right now, although I do wish I could. I also see there are some related issues ("slow query") but it doesn't look like they're related to notifications.
If anyone can have a look, thanks in advance !https://git.pleroma.social/pleroma/pleroma/-/issues/3217scoped notifications2024-02-06T05:43:42ZJeff Cliffscoped notificationshttps://a2mi.social/@MegaMichelle/111385398640070512
https://infosec.exchange/@CppGuy/111393303860768677
@MegaMichelle@a2mi.social
came up with an interesting and useful idea(originally for mastodong but equally valid idea for pleroma)...https://a2mi.social/@MegaMichelle/111385398640070512
https://infosec.exchange/@CppGuy/111393303860768677
@MegaMichelle@a2mi.social
came up with an interesting and useful idea(originally for mastodong but equally valid idea for pleroma): thread scoped notifications
here's the scenario
Dr. A actually knows something about topic B.
Dr. A is in a thread with a bunch of dumb shits who waste everyone's time, we'll call them C D E F and G.
Dr. A wades in every couple 1000 posts and says something like "no actually blahblahblah" and then goes back to lurking and watching C D E F and G talk amongst themselves
what Dr. A says is actually valuable but *not* valuable enough to auto notify based on *every* thread he's in. Perhaps you're particularly interested in what he says about topic B. You could search by hashtag, or by keyword, but another useful thing would be is if the fact that he was posting in that thread itself was occurring, that you want to be notified.
Perhaps some kind of option right around the 'mute this thread' one could be 'notify when this user participates in this thread'.https://git.pleroma.social/pleroma/pleroma/-/issues/3215Replace clear_config with explicit mocks via Mox2024-02-06T05:44:13ZlainReplace clear_config with explicit mocks via Moxclear_config changes the global state and makes it impossible for tests to run asynchronously.clear_config changes the global state and makes it impossible for tests to run asynchronously.https://git.pleroma.social/pleroma/pleroma/-/issues/3214Replace Mock/Meck with Mox2024-02-06T05:43:54ZlainReplace Mock/Meck with MoxMock/Meck work by redefining modules and modifying the global state, making it impossible to run tests that use them async. Mox requires an explicit contract/behaviour and allows for per-process mocking, like Tesla's mock.
Mock is used ...Mock/Meck work by redefining modules and modifying the global state, making it impossible to run tests that use them async. Mox requires an explicit contract/behaviour and allows for per-process mocking, like Tesla's mock.
Mock is used in at least these files:
```
test/pleroma/upload/filter/mogrify_test.exs
test/pleroma/upload/filter/mogrifun_test.exs
test/pleroma/workers/receiver_worker_test.exs
test/pleroma/user/backup_test.exs
test/pleroma/application_requirements_test.exs
test/pleroma/object/fetcher_test.exs
test/pleroma/user_relationship_test.exs
test/pleroma/web/activity_pub/relay_test.exs
test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs
test/pleroma/web/activity_pub/side_effects_test.exs
test/pleroma/web/admin_api/controllers/user_controller_test.exs
test/pleroma/web/activity_pub/publisher_test.exs
test/pleroma/web/activity_pub/activity_pub_test.exs
test/pleroma/web/activity_pub/transmogrifier_test.exs
test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs
test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs
test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs
test/pleroma/web/federator_test.exs
test/pleroma/activity/ir/topics_test.exs
test/pleroma/web/media_proxy/invalidation_test.exs
test/pleroma/web/twitter_api/util_controller_test.exs
test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
test/pleroma/web/plugs/plug_helper_test.exs
test/pleroma/web/plugs/http_signature_plug_test.exs
test/pleroma/web/plugs/o_auth_scopes_plug_test.exs
test/pleroma/web/media_proxy/media_proxy_controller_test.exs
test/pleroma/web/plugs/frontend_static_plug_test.exs
test/pleroma/web/o_auth/ldap_authorization_test.exs
test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs
test/pleroma/web/common_api_test.exs
test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs
test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs
test/pleroma/web/mastodon_api/update_credentials_test.exs
test/pleroma/notification_test.exs
test/pleroma/signature_test.exs
test/pleroma/uploaders/s3_test.exs
test/mix/tasks/pleroma/uploads_test.exs
test/mix/tasks/pleroma/user_test.exs
```https://git.pleroma.social/pleroma/pleroma/-/issues/3213After running `mix deps.unlock --unused` to clean up the mix.lock file, tests...2024-02-06T05:44:35ZlainAfter running `mix deps.unlock --unused` to clean up the mix.lock file, tests reliable fail for me in non-obvious waysEncountered while working on https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3967. Maybe the deps are different between the test and dev environment?Encountered while working on https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3967. Maybe the deps are different between the test and dev environment?https://git.pleroma.social/pleroma/pleroma/-/issues/3212only_safe query parameter for nsfw free timelines, option to default for unau...2024-02-06T05:44:56Zplebonly_safe query parameter for nsfw free timelines, option to default for unauthenticated userssaw this requested, figured to write it up at least partly
rewrite restrict_media in lib/pleroma/web/activity_pub/activity_pub.ex fetch_activities_query
to a case statement and include only_safe via a similar query
```
defp restrict_m...saw this requested, figured to write it up at least partly
rewrite restrict_media in lib/pleroma/web/activity_pub/activity_pub.ex fetch_activities_query
to a case statement and include only_safe via a similar query
```
defp restrict_media(query, %{} = opts) do
case opts do
%{only_media: true} ->
from(
[activity, object] in query,
where: fragment("(?)->>'type' = 'Create'", activity.data),
where: fragment("(?)->'attachment' <> '[]'", object.data)
)
%{only_safe: true} ->
from(
[activity, object] in query,
where: fragment("(?)->>'type' = 'Create'", activity.data),
where: fragment("(?)->'sensitive' <> 'true'", object.data),
where: fragment("(?)->'attachment' = '[]'", object.data)
)
_ ->
query
end
end
```
an option to force it for users not logged in was tacked on, but i'm not sure on the place to deal with that, adding a :media Config to `restrict_unauthenticated` is clear, but not which code path it should apply tohttps://git.pleroma.social/pleroma/pleroma/-/issues/3211Pleroma.Instances.Instance is missing a `on_replace: :update`2024-02-06T05:45:36ZplebPleroma.Instances.Instance is missing a `on_replace: :update`iex(pleroma@declin)1\> Pleroma.Instances.Instance.get_or_update_metadata(URI.parse("https://lain.com"))
a test case for the update part is missing, and a call to get_or_update_metadata to actually populate it
<details>
<summary>
\*\* ...iex(pleroma@declin)1\> Pleroma.Instances.Instance.get_or_update_metadata(URI.parse("https://lain.com"))
a test case for the update part is missing, and a call to get_or_update_metadata to actually populate it
<details>
<summary>
\*\* (RuntimeError) you are attempting to change relation :metadata of Pleroma.Instances.Instance but the \`:on_replace\` option of this relation is set to \`:raise\`.
</summary>
By default it is not possible to replace or delete embeds and associations during \`cast\`. Therefore Ecto requires the parameters given to \`cast\` to have IDs matching the data currently associated to Pleroma.Instances.Instance. Failing to do so results in this error message.
If you want to replace data or automatically delete any data not sent to `cast`, please set the appropriate `:on_replace` option when defining the relation. The docs for `Ecto.Changeset` covers the supported options in the "Associations, embeds and on replace" section.
However, if you don't want to allow data to be replaced or deleted, only updated, make sure that:
* If you are attempting to update an existing entry, you are including the entry primary key (ID) in the data.
* If you have a relationship with many children, all children must be given on update.
</details>
the only thing probably using this functionality in the wild is https://256.lt/mrf/software_policy.ex which tries to use both incompatible implementations
plz fixhttps://git.pleroma.social/pleroma/pleroma/-/issues/3210Remove/disable the built-in emoji2024-02-06T05:47:13ZpiggoRemove/disable the built-in emojiI wanted to hide the three emoji that come by default with pleroma.
The diff below worked, but I now have dirty git, it doesn't look right.
- Why are they there? Just for unit tests?
- blank.png makes sense for emoji graphics, but the...I wanted to hide the three emoji that come by default with pleroma.
The diff below worked, but I now have dirty git, it doesn't look right.
- Why are they there? Just for unit tests?
- blank.png makes sense for emoji graphics, but the other two?
- Is there a more proper way to remove them?
```diff
diff --git a/config/emoji.txt b/config/emoji.txt
index 52b714ee5..8b1378917 100644
--- a/config/emoji.txt
+++ b/config/emoji.txt
@@ -1,3 +1 @@
-firefox, /emoji/Firefox.gif, Gif,Fun
-blank, /emoji/blank.png, Fun
-dinosaur, /emoji/dino walking.gif, Gif
+
diff --git a/priv/static/emoji/Firefox.gif b/priv/static/emoji/Firefox.gif
deleted file mode 100644
index 81561d94b..000000000
Binary files a/priv/static/emoji/Firefox.gif and /dev/null differ
diff --git a/priv/static/emoji/blank.png b/priv/static/emoji/blank.png
deleted file mode 100644
index 8f50fa023..000000000
Binary files a/priv/static/emoji/blank.png and /dev/null differ
diff --git a/priv/static/emoji/dino walking.gif b/priv/static/emoji/dino walking.gif
deleted file mode 100644
index 694a541e7..000000000
Binary files a/priv/static/emoji/dino walking.gif and /dev/null differ
```https://git.pleroma.social/pleroma/pleroma/-/issues/3206500 on inbox delivery of federated reply2024-02-06T05:39:41Zsnarfed500 on inbox delivery of federated replyHi all! I build and run https://fed.brid.gy/ . I've been working on an interop issue with Pleroma for a while on and off: when I deliver a reply to a Pleroma inbox, I get a 500 back with response body `"error"`. Background in https://git...Hi all! I build and run https://fed.brid.gy/ . I've been working on an interop issue with Pleroma for a while on and off: when I deliver a reply to a Pleroma inbox, I get a 500 back with response body `"error"`. Background in https://github.com/snarfed/bridgy-fed/issues/12 , details below. Maybe related to #2884? Not sure. Thanks in advance for looking, and for maintaining Pleroma!
The latest instance of this was delivering the activity below to https://sironi.tk/users/luca/inbox . sironi.tk evidently runs Pleroma 2.5.5, which I know is older than your latest 2.6.0 release. I'm happy to test against 2.6.0 if you want to point me to an instance running it!
```
2023-11-08 14:23:57.450 UTC
POST https://sironi.tk/users/luca/inbox
[HTTP Signature headers for keyId https://fed.brid.gy/snarfed.org#key ]
```
```json
{
"id": "https://fed.brid.gy/r/https://snarfed.org/2023-11-08_sironi-tk#bridgy-fed-create-c",
"actor": "https://fed.brid.gy/snarfed.org",
"published": "2023-11-08T14:09:50.134166+00:00",
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"object": {
"published": "2023-11-08T06:09:44-08:00",
"content": "<a class=\"u-in-reply-to\" href=\"https://sironi.tk/notice/AbansIUFY43IrYaFMG\"></a>\n<div class=\"e-content\">\nThank you for the offer! I wouldn\u2019t worry about it right now though. The sandbox isn\u2019t really intended for normal users, and I still have tons to do before I run out of my own testing anyway. I appreciate the idea though!\n</div>",
"url": "https://fed.brid.gy/r/https://snarfed.org/2023-11-08_sironi-tk",
"id": "https://fed.brid.gy/r/https://snarfed.org/2023-11-08_sironi-tk",
"type": "Note",
"attributedTo": "https://fed.brid.gy/snarfed.org",
"inReplyTo": "https://sironi.tk/objects/72418a30-4a04-49a8-bde8-083dee651f8a",
"cc": [
"https://sironi.tk/users/luca",
"https://fed.brid.gy/snarfed.org",
"https://www.w3.org/ns/activitystreams#Public",
"https://venera.social/profile/activitypubblueskybridge",
"https://sironi.tk/users/luca/followers"
],
"contentMap": {
"en": "<a class=\"u-in-reply-to\" href=\"https://sironi.tk/notice/AbansIUFY43IrYaFMG\"></a>\n<div class=\"e-content\">\nThank you for the offer! I wouldn\u2019t worry about it right now though. The sandbox isn\u2019t really intended for normal users, and I still have tons to do before I run out of my own testing anyway. I appreciate the idea though!\n</div>"
},
"tag": [{
"type": "Mention",
"href": "https://sironi.tk/users/luca"
}],
"to": ["https://www.w3.org/ns/activitystreams#Public"]
},
"to": ["https://www.w3.org/ns/activitystreams#Public"]
}
```https://git.pleroma.social/pleroma/pleroma/-/issues/3205Support group actor2023-12-27T17:28:33ZtusooaSupport group actorPart of https://git.pleroma.social/pleroma/pleroma/-/issues/656
Backend-wise:
- Ability to mark an actor as Group.
- Upon receiving an Object that has a local Group in its `to` field, boost it automatically if it is boostable.
- If the ...Part of https://git.pleroma.social/pleroma/pleroma/-/issues/656
Backend-wise:
- Ability to mark an actor as Group.
- Upon receiving an Object that has a local Group in its `to` field, boost it automatically if it is boostable.
- If the local Group is only `cc`d, no boost is generated.
- If the local Group has blocked the author of the Object, do not boost.
- If multiple local Groups are mentioned, it should generate multiple boosts.tusooatusooa