From aa396c78d30c129bb2145765d3990571dbc025bb Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:45:46 +0100 Subject: [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 --- internal/db/bundb/account.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/db') diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go index cdb949efa..705e1b118 100644 --- a/internal/db/bundb/account.go +++ b/internal/db/bundb/account.go @@ -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) -- cgit v1.2.3