summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-08 14:32:17 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-08 14:32:17 +0000
commite9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch)
tree52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/db/bundb/relationship.go
parent[chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff)
downloadgotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/db/bundb/relationship.go')
-rw-r--r--internal/db/bundb/relationship.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/internal/db/bundb/relationship.go b/internal/db/bundb/relationship.go
index 822e697c1..138a5aa17 100644
--- a/internal/db/bundb/relationship.go
+++ b/internal/db/bundb/relationship.go
@@ -199,7 +199,8 @@ func (r *relationshipDB) getAccountFollowIDs(ctx context.Context, accountID stri
// Follow IDs not in cache, perform DB query!
q := newSelectFollows(r.db, accountID)
- if _, err := q.Exec(ctx, &followIDs); err != nil {
+ if _, err := q.Exec(ctx, &followIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -213,7 +214,8 @@ func (r *relationshipDB) getAccountLocalFollowIDs(ctx context.Context, accountID
// Follow IDs not in cache, perform DB query!
q := newSelectLocalFollows(r.db, accountID)
- if _, err := q.Exec(ctx, &followIDs); err != nil {
+ if _, err := q.Exec(ctx, &followIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -227,7 +229,8 @@ func (r *relationshipDB) getAccountFollowerIDs(ctx context.Context, accountID st
// Follow IDs not in cache, perform DB query!
q := newSelectFollowers(r.db, accountID)
- if _, err := q.Exec(ctx, &followIDs); err != nil {
+ if _, err := q.Exec(ctx, &followIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -241,7 +244,8 @@ func (r *relationshipDB) getAccountLocalFollowerIDs(ctx context.Context, account
// Follow IDs not in cache, perform DB query!
q := newSelectLocalFollowers(r.db, accountID)
- if _, err := q.Exec(ctx, &followIDs); err != nil {
+ if _, err := q.Exec(ctx, &followIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -255,7 +259,8 @@ func (r *relationshipDB) getAccountFollowRequestIDs(ctx context.Context, account
// Follow request IDs not in cache, perform DB query!
q := newSelectFollowRequests(r.db, accountID)
- if _, err := q.Exec(ctx, &followReqIDs); err != nil {
+ if _, err := q.Exec(ctx, &followReqIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -269,7 +274,8 @@ func (r *relationshipDB) getAccountFollowRequestingIDs(ctx context.Context, acco
// Follow request IDs not in cache, perform DB query!
q := newSelectFollowRequesting(r.db, accountID)
- if _, err := q.Exec(ctx, &followReqIDs); err != nil {
+ if _, err := q.Exec(ctx, &followReqIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}
@@ -283,7 +289,8 @@ func (r *relationshipDB) getAccountBlockIDs(ctx context.Context, accountID strin
// Block IDs not in cache, perform DB query!
q := newSelectBlocks(r.db, accountID)
- if _, err := q.Exec(ctx, &blockIDs); err != nil {
+ if _, err := q.Exec(ctx, &blockIDs); // nocollapse
+ err != nil && !errors.Is(err, db.ErrNoEntries) {
return nil, err
}