From 689a10fe176706342704dc75e10d7c1f23d35540 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:11:10 +0100 Subject: [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 --- internal/processing/fromcommon.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/processing/fromcommon.go') diff --git a/internal/processing/fromcommon.go b/internal/processing/fromcommon.go index a09d428e8..3e4c62c6c 100644 --- a/internal/processing/fromcommon.go +++ b/internal/processing/fromcommon.go @@ -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 { -- cgit v1.2.3