[chore] tidy + test timelines a bit better (#1865)

* [chore] tidy + test timelines a bit better

* thanks linter
This commit is contained in:
tobi 2023-06-04 18:55:30 +02:00 committed by GitHub
commit 97bc2e713a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 685 additions and 479 deletions

View file

@ -20,7 +20,8 @@ package timeline
import (
"container/list"
"context"
"fmt"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
)
type indexedItems struct {
@ -84,7 +85,7 @@ func (i *indexedItems) insertIndexed(ctx context.Context, newEntry *indexedItems
currentEntry.boostOfAccountID,
currentPosition,
); err != nil {
return false, fmt.Errorf("insertIndexed: error calling skipInsert: %w", err)
return false, gtserror.Newf("error calling skipInsert: %w", err)
} else if skip {
// We don't need to insert this at all,
// so we can safely bail.