[bugfix] API status edit history returned in inverse order (#4432)

Simply reverses the order in which we build status edit history for the frontend. In fact now it matches how we store it in the database which is even easier :p. Why I thought it needed to be returned inverse to begin with? Who knows.

closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4426 (thank you [@DarkCat09](https://codeberg.org/DarkCat09) for pointing it out!)

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4432
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2025-09-15 18:28:48 +02:00 committed by kim
commit 882d07db5f
5 changed files with 226 additions and 117 deletions

View file

@ -96,8 +96,8 @@ func (s *statusEditDB) GetStatusEditsByIDs(ctx context.Context, ids []string) ([
return nil, err
}
// Reorder the edits by their
// IDs to ensure in correct order.
// Reorder the edits by their IDs to ensure in correct
// order (ID ascending, ie., latest to oldest edit).
getID := func(e *gtsmodel.StatusEdit) string { return e.ID }
xslices.OrderBy(edits, ids, getID)