summaryrefslogtreecommitdiff
path: root/internal/processing/workers
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-09-23 11:53:42 +0000
committerLibravatar GitHub <noreply@github.com>2024-09-23 11:53:42 +0000
commit4592e290872e0208d03189aea4f410cd47a5dc1d (patch)
tree00df4221fc924e8fdcafc985f33c0395687a711c /internal/processing/workers
parent[chore] header filter improvements (#3329) (diff)
downloadgotosocial-4592e290872e0208d03189aea4f410cd47a5dc1d.tar.xz
[chore] local instance count query caching, improved status context endpoint logging, don't log ErrHideStatus when timelining (#3330)
* ensure that errors checking status visibility / converting aren't dropped * add some more context to error messages * include calling function name in log entries * don't error on timelining hidden status * further code to ignore statusfilter.ErrHideStatus type errors * remove unused error type * add local instance status / domain / user counts * add checks for localhost * rename from InstanceCounts to LocalInstance * improved code comment
Diffstat (limited to 'internal/processing/workers')
-rw-r--r--internal/processing/workers/surfacetimeline.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/internal/processing/workers/surfacetimeline.go b/internal/processing/workers/surfacetimeline.go
index 90cb1fed3..b071bd72e 100644
--- a/internal/processing/workers/surfacetimeline.go
+++ b/internal/processing/workers/surfacetimeline.go
@@ -384,8 +384,9 @@ func (s *Surface) timelineStatus(
) (bool, error) {
// Ingest status into given timeline using provided function.
- if inserted, err := ingest(ctx, timelineID, status); err != nil {
- err = gtserror.Newf("error ingesting status %s: %w", status.ID, err)
+ if inserted, err := ingest(ctx, timelineID, status); err != nil &&
+ !errors.Is(err, statusfilter.ErrHideStatus) {
+ err := gtserror.Newf("error ingesting status %s: %w", status.ID, err)
return false, err
} else if !inserted {
// Nothing more to do.
@@ -400,15 +401,19 @@ func (s *Surface) timelineStatus(
filters,
mutes,
)
- if err != nil {
- err = gtserror.Newf("error converting status %s to frontend representation: %w", status.ID, err)
+ if err != nil && !errors.Is(err, statusfilter.ErrHideStatus) {
+ err := gtserror.Newf("error converting status %s to frontend representation: %w", status.ID, err)
return true, err
}
- // The status was inserted so stream it to the user.
- s.Stream.Update(ctx, account, apiStatus, streamType)
+ if apiStatus != nil {
+ // The status was inserted so stream it to the user.
+ s.Stream.Update(ctx, account, apiStatus, streamType)
+ return true, nil
+ }
- return true, nil
+ // Status was hidden.
+ return false, nil
}
// timelineAndNotifyStatusForTagFollowers inserts the status into the