mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

Fix REST API serializer for Account not including `moved` when the moved account has itself moved

Open ClearlyClaire opened this issue 3 years ago • 2 comments

Fixes #22483 Related: #22131

Instead of cutting immediately, cut after one recursion.

This fixes clients (including the Web UI) showing accounts that have moved to accounts that have themselves moved as not having moved at all.

Despite the moved to account's moved not itself being rendered, this fixes the WebUI's behavior entirely, as visiting a profile triggers an API call. I am not sure how various clients handle that.

ClearlyClaire avatar Dec 19 '22 11:12 ClearlyClaire

Does cutting after one recursion mean it will follow one extra level of indirection but not two, or does it mean it halts when a loop is detected?

mcclure avatar Dec 19 '22 17:12 mcclure

It means if A redirects to B and B redirects to C, /api/v1/accounts/:id_for_a will return A with an embedded B in the moved attribute, but B will not have a moved attribute. Current behavior is for A to not have a moved attribute.

ClearlyClaire avatar Dec 19 '22 17:12 ClearlyClaire