[feature] serdes for moved/also_known_as (#2600)

* [feature] serdes for moved/also_known_as

* document `alsoKnownAs` and `movedTo` properties

* only implicitly populate AKA uris from DB for local accounts

* don't let remotes store more than 20 AKA uris to avoid shenanigans
This commit is contained in:
tobi 2024-02-06 10:45:46 +01:00 committed by GitHub
commit aa396c78d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 392 additions and 22 deletions

View file

@ -279,7 +279,12 @@ func (a *accountDB) PopulateAccount(ctx context.Context, account *gtsmodel.Accou
}
}
if !account.AlsoKnownAsPopulated() {
// Only try to populate AlsoKnownAs for local accounts,
// since those are the only accounts to which it's relevant.
//
// AKA from remotes might have loads of random-ass values
// set here, and we don't want to do lots of failing DB calls.
if account.IsLocal() && !account.AlsoKnownAsPopulated() {
// Account alsoKnownAs accounts are
// out-of-date with URIs, repopulate.
alsoKnownAs := make([]*gtsmodel.Account, 0)