~tsileo/microblog.pub-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
6 4

[PATCH microblog.pub 0/1] fix unshare

Details
Message ID
<166949028625.13139.10529655211890696528-0@git.sr.ht>
DKIM signature
missing
Download raw message
Hi,

I unshared a message that I had accidentally shared.
Although it was effectively unshared on my profile, it was still present
on federated instances.

I found no errors in logs, but the list of recipients was empty (unlike
the list of recipients in the "Announce" activity):

2022-11-25 21:23:23.044 | INFO     | app.main:__call__:168 |
2c6af0f7f96af82e - xxx.xxx.xxx.xxx:0 - POST
https://xxx.xxx.xxx.xxx:8000/admin/actions/undo - "Mozilla/5.0 (Android
10; Mobile; rv:105.0) Gecko/105.0 Firefox/105.0"
2022-11-25 21:23:23.160 | INFO     | app.boxes:_compute_recipients:891 |
2c6af0f7f96af82e - []
INFO:     xxx.xxx.xxx.xxx:0 - "POST /admin/actions/undo HTTP/1.0" 302
Found

Recipients were retrieved directly from the "Undo" activity
(outbox_object) instead of the "Announce" activity.

Sam (1):
  fix unshare by getting recipients from Announce activity instead of
    Undo

 app/boxes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.34.5

[PATCH microblog.pub 1/1] fix unshare by getting recipients from Announce activity instead of Undo

Details
Message ID
<166949028625.13139.10529655211890696528-1@git.sr.ht>
In-Reply-To
<166949028625.13139.10529655211890696528-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +1 -1
From: Sam <samr1.dev@pm.me>

---
 app/boxes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/boxes.py b/app/boxes.py
index 8ebd7e2..d162fc5 100644
--- a/app/boxes.py
+++ b/app/boxes.py
@@ -427,7 +427,7 @@ async def _send_undo(db_session: AsyncSession, ap_object_id: str) -> None:
        announced_object.announced_via_outbox_object_ap_id = None

        # Send the Undo to the original recipients
        recipients = await _compute_recipients(db_session, outbox_object.ap_object)
        recipients = await _compute_recipients(db_session, announced_object.ap_object)
        for rcp in recipients:
            await new_outgoing_activity(db_session, rcp, outbox_object.id)
    elif outbox_object_to_undo.ap_type == "Block":
-- 
2.34.5
Details
Message ID
<5781aaad-1a3a-4d98-942d-c7aed19748aa@app.fastmail.com>
In-Reply-To
<166949028625.13139.10529655211890696528-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Hey,

Good catch (again)! Thank you I just applied it.

Thanks!
Alexey Shpakovsky <alexey@shpakovsky.ru>
Details
Message ID
<53fa4d91c995c096c6ac5072417e1476.squirrel@squirrelmail.shpakovsky.ru>
In-Reply-To
<5781aaad-1a3a-4d98-942d-c7aed19748aa@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
Hey, I believe this change introduced another issue: now "unshare" events
are sent to followers of author of the _original_ post - while I believe
they should be sent to _my_ followers (but please correct me if I'm wrong
here).

What I saw was:

When I tried to share and (immediately) unshare a post by a popular user
(see, for example, latest post shared by https://microblog.pub/), I got a
server error.

data/uvicorn.log file shows that microblog.pub tried to fetch all
followers of the author of original post (in this case it was
https://social.wake.st/@liaizon with 3.7k followers), and after it fetched
300 pages(!!) from remote server - they responded with '429 Too Many
Requests'.

This doesn't look right :)

I think if we didn't preserve list of people who received original
"announce" event - then the best we can do is to send the "undo announce"
event to all our _current_ followers.
Details
Message ID
<c972564f-8197-4f25-a6cf-fb5c1f0ce788@app.fastmail.com>
In-Reply-To
<53fa4d91c995c096c6ac5072417e1476.squirrel@squirrelmail.shpakovsky.ru> (view parent)
DKIM signature
missing
Download raw message
Oops, that's a good catch, I just pushed a fix.

It should re-use the recipients on the `Announce`: https://git.sr.ht/~tsileo/microblog.pub/commit/34c7cdb5fb9c5b681f91fd52c6323bb22c46a4ad

Thanks!
Details
Message ID
<e9LCT2JvRfCwHEnunTsYCEZ3MazkT4_qKdVgkd3AnbaK508ayXxIrfC5hixrlfN8zXB19jXqmfoLjaplelWNld1ZtBToxvxEnom9UV_q9KA=@pm.me>
In-Reply-To
<c972564f-8197-4f25-a6cf-fb5c1f0ce788@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
Hi,

sorry for the bug, I was just about to push a fix.

thanks for the patch.


------- Original Message -------
On Friday, December 2nd, 2022 at 18:50, Thomas Sileo <t@a4.io> wrote:


> 
> 
> Oops, that's a good catch, I just pushed a fix.
> 
> It should re-use the recipients on the `Announce`: https://git.sr.ht/~tsileo/microblog.pub/commit/34c7cdb5fb9c5b681f91fd52c6323bb22c46a4ad
> 
> Thanks!
Alexey Shpakovsky <alexey@shpakovsky.ru>
Details
Message ID
<1008056293244d5927b1f827494e4edc.squirrel@squirrelmail.shpakovsky.ru>
In-Reply-To
<c972564f-8197-4f25-a6cf-fb5c1f0ce788@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
~tsileo: Thanks for the quick fix, as always!

~samr1: No problem, happens to all of us!
Reply to thread Export thread (mbox)