From f4319740ab02d680961781861335285f618f5f48 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:43:17 +0100 Subject: [bugfix] more robust list timeline invalidation (#1995) --- internal/processing/admin/report.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'internal/processing/admin') diff --git a/internal/processing/admin/report.go b/internal/processing/admin/report.go index 174bd3c24..e99cc2ec0 100644 --- a/internal/processing/admin/report.go +++ b/internal/processing/admin/report.go @@ -54,22 +54,14 @@ func (p *Processor) ReportsGet( count := len(reports) items := make([]interface{}, 0, count) - nextMaxIDValue := "" - prevMinIDValue := "" - for i, r := range reports { + nextMaxIDValue := reports[count-1].ID + prevMinIDValue := reports[0].ID + + for _, r := range reports { item, err := p.tc.ReportToAdminAPIReport(ctx, r, account) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting report to api: %s", err)) } - - if i == count-1 { - nextMaxIDValue = item.ID - } - - if i == 0 { - prevMinIDValue = item.ID - } - items = append(items, item) } -- cgit v1.3