jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.1k stars 84 forks source link

do not retry unmute if mute never expires #666

Closed alphatownsman closed 7 months ago

alphatownsman commented 7 months ago

it seems currently the mute state stuck in awaiting_expiry and loop every hour even if it does not have to.

let me know if I should add migration like

update users_block set state = 'sent' where mute=true and expires is null;
andrewgodwin commented 7 months ago

The bug here appears to be that there is a sent state at all - I intended for all mutes to live in awaiting_expiry even if they aren't expirable when I wrote this. This patch isn't sufficient by itself to get to the end effect of not checking these states; I'd instead want to see:

alphatownsman commented 7 months ago

@andrewgodwin good point on create_local_mute, had a quick patch on that.

as for sent -> permanent, it makes sense but seems more lines to change. also I kind of feel that we have to be open to some compromises if mute and block are sharing one model.

can we make a quick fix for the endless hourly loop first, before a refactor on states?

andrewgodwin commented 7 months ago

Yeah, with the create_local_mute patch I think that's good for now - and you're right, the sharing of the model with Block does complicate things somewhat.