mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 13:22:24 -06:00
[chore] Tidy up status deletion, remove from cache too (#845)
* add func for deleting status from db + cache * move deletes entirely back to processor and also only do a delete if the requesting account owns the item being deleted * tidy up unboost processing * delete status more efficiently * fix wrong account id on remote test attachments * fix federator test
This commit is contained in:
parent
8c20626c51
commit
4cf76a2bfc
12 changed files with 113 additions and 94 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
type StatusTestSuite struct {
|
||||
|
|
@ -132,6 +133,15 @@ func (suite *StatusTestSuite) TestGetStatusChildren() {
|
|||
}
|
||||
}
|
||||
|
||||
func (suite *StatusTestSuite) TestDeleteStatus() {
|
||||
targetStatus := suite.testStatuses["admin_account_status_1"]
|
||||
err := suite.db.DeleteStatusByID(context.Background(), targetStatus.ID)
|
||||
suite.NoError(err)
|
||||
|
||||
_, err = suite.db.GetStatusByID(context.Background(), targetStatus.ID)
|
||||
suite.ErrorIs(err, db.ErrNoEntries)
|
||||
}
|
||||
|
||||
func TestStatusTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(StatusTestSuite))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue