Merge branch 'main' into media_refactor

This commit is contained in:
tsmethurst 2022-02-08 12:17:18 +01:00
commit 4c294a596a
78 changed files with 1853 additions and 794 deletions

View file

@ -231,7 +231,8 @@ func (f *federatingDB) createNote(ctx context.Context, note vocab.ActivityStream
status.ID = statusID
if err := f.db.PutStatus(ctx, status); err != nil {
if err == db.ErrAlreadyExists {
var alreadyExistsError *db.ErrAlreadyExists
if errors.As(err, &alreadyExistsError) {
// the status already exists in the database, which means we've already handled everything else,
// so we can just return nil here and be done with it.
return nil