[bugfix/chore] Announce reliability updates (#2405)

* [bugfix/chore] `Announce` updates

* test update

* fix tests

* TestParseAnnounce

* update comments

* don't lock/unlock, change function signature

* naming stuff

* don't check domain block twice

* UnwrapIfBoost

* beep boop
This commit is contained in:
tobi 2023-12-01 15:27:15 +01:00 committed by GitHub
commit 0e2c342191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 425 additions and 285 deletions

View file

@ -50,8 +50,10 @@ func (suite *AnnounceTestSuite) TestNewAnnounce() {
suite.True(ok)
suite.Equal(announcingAccount.ID, boost.AccountID)
// only the URI will be set on the boosted status because it still needs to be dereferenced
suite.NotEmpty(boost.BoostOf.URI)
// only the URI will be set for the boosted status
// because it still needs to be dereferenced
suite.Nil(boost.BoostOf)
suite.Equal("http://example.org/users/Some_User/statuses/afaba698-5740-4e32-a702-af61aa543bc1", boost.BoostOfURI)
}
func (suite *AnnounceTestSuite) TestAnnounceTwice() {
@ -81,8 +83,10 @@ func (suite *AnnounceTestSuite) TestAnnounceTwice() {
return nil
})
// only the URI will be set on the boosted status because it still needs to be dereferenced
suite.NotEmpty(boost.BoostOf.URI)
// only the URI will be set for the boosted status
// because it still needs to be dereferenced
suite.Nil(boost.BoostOf)
suite.Equal("http://example.org/users/Some_User/statuses/afaba698-5740-4e32-a702-af61aa543bc1", boost.BoostOfURI)
ctx2 := createTestContext(receivingAccount2, announcingAccount)
announce2 := suite.testActivities["announce_forwarded_1_turtle"]