[bugfix] Fix deleted status causing issues when getting bookmark (#1551)

* [bugfix] Delete bookmark when status deleted

* [chore] Give bookmark processing func some love

* fix paging + embetter tests
This commit is contained in:
tobi
2023-02-23 23:11:10 +01:00
committed by GitHub
parent 074f352709
commit 689a10fe17
3 changed files with 262 additions and 60 deletions

View File

@ -456,6 +456,11 @@ func (p *Processor) wipeStatus(ctx context.Context, statusToDelete *gtsmodel.Sta
return err
}
// delete all bookmarks that point to this status
if err := p.db.DeleteWhere(ctx, []db.Where{{Key: "status_id", Value: statusToDelete.ID}}, &[]*gtsmodel.StatusBookmark{}); err != nil {
return err
}
// delete all boosts for this status + remove them from timelines
if boosts, err := p.db.GetStatusReblogs(ctx, statusToDelete); err == nil {
for _, b := range boosts {