diff options
author | 2023-11-30 11:32:45 +0000 | |
---|---|---|
committer | 2023-11-30 12:32:45 +0100 | |
commit | 5fd2e427bb1c8fb9f7f27a60d60283f16a976875 (patch) | |
tree | 789da987c9b0f4d3fc906b9b2d6f0fc8e245d169 /internal/processing/workers/fromfediapi.go | |
parent | [chore] Re-add indexes, rename account actions indexes (#2401) (diff) | |
download | gotosocial-5fd2e427bb1c8fb9f7f27a60d60283f16a976875.tar.xz |
[bugfix] always go through status parent dereferencing on isNew, even on data-race (#2402)
* no need to deref status author account, will already be deref'd during previous getStatusByAP{IRI,Model}()
* don't unset the isNew flag on dereference data race
* improved code comment
Diffstat (limited to 'internal/processing/workers/fromfediapi.go')
-rw-r--r-- | internal/processing/workers/fromfediapi.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/internal/processing/workers/fromfediapi.go b/internal/processing/workers/fromfediapi.go index 9558bf8b7..a8da50819 100644 --- a/internal/processing/workers/fromfediapi.go +++ b/internal/processing/workers/fromfediapi.go @@ -19,7 +19,6 @@ package workers import ( "context" - "net/url" "codeberg.org/gruf/go-kv" "codeberg.org/gruf/go-logger/v2/level" @@ -169,25 +168,6 @@ func (p *fediAPI) CreateStatus(ctx context.Context, fMsg messages.FromFediAPI) e return gtserror.Newf("error extracting status from federatorMsg: %w", err) } - if status.Account == nil || status.Account.IsRemote() { - // Either no account attached yet, or a remote account. - // Both situations we need to parse account URI to fetch it. - accountURI, err := url.Parse(status.AccountURI) - if err != nil { - return gtserror.Newf("error parsing account uri: %w", err) - } - - // Ensure that account for this status has been deref'd. - status.Account, _, err = p.federate.GetAccountByURI( - ctx, - fMsg.ReceivingAccount.Username, - accountURI, - ) - if err != nil { - return gtserror.Newf("error getting account by uri: %w", err) - } - } - if status.InReplyToID != "" { // Interaction counts changed on the replied status; uncache the // prepared version from all timelines. The status dereferencer |