[bugfix] parent status replied to status not dereferenced sometimes (#2587)

* much simplified DereferenceStatusAncestors(), also handles edge cases now

* perform status acceptibility check before handling even as forward

* don't further dereference ancestors if they're up to date

* call enrichStatusSafely() directly to ensure we get error messages

* change getStatusByURI() semantics to return error + old model on failed update, fix deref ancestor to check for staleness before refetch

* perform a nil-check on the status.Local variable, in case it hasn't been set on new status attempting refresh

* more consistently set returned parent status, don't check if updated

* only home-timeline statuses if explicitly visible AND not explicitly invisible!

* fix broken test now that status acceptibility checks happen on forwarded statuses
This commit is contained in:
kim
2024-01-31 13:29:47 +00:00
committed by GitHub
parent 81198fa2d0
commit 0f7a2024c3
6 changed files with 230 additions and 237 deletions

View File

@@ -26,6 +26,8 @@ import (
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/id"
"github.com/superseriousbusiness/gotosocial/internal/util"
)
type CreateTestSuite struct {
@@ -60,7 +62,20 @@ func (suite *CreateTestSuite) TestCreateNoteForward() {
create := suite.testActivities["forwarded_message"].Activity
err := suite.federatingDB.Create(ctx, create)
// ensure a follow exists between requesting
// and receiving account, this ensures the forward
// will be seen as "relevant" and not get dropped.
err := suite.db.PutFollow(ctx, &gtsmodel.Follow{
ID: id.NewULID(),
URI: "https://this.is.a.url",
AccountID: receivingAccount.ID,
TargetAccountID: requestingAccount.ID,
ShowReblogs: util.Ptr(true),
Notify: util.Ptr(false),
})
suite.NoError(err)
err = suite.federatingDB.Create(ctx, create)
suite.NoError(err)
// should be a message heading to the processor now, which we can intercept here