imorland / follow-users

MIT License
4 stars 5 forks source link

fix: switch to `UserSerializer` for `followedUsers` relationship #39

Closed DavideIadeluca closed 3 months ago

DavideIadeluca commented 3 months ago

An issue was brought to my attention, that sometimes user data on the followedUsers page is missing / inconsistent. When hard refreshing the page, some of the relations are missing and wrong or no data is displayed in the UserCard. Only after navigating to a user in the list and navigating back, the data was correctly populated. It appears that it has been an issue since this PR https://github.com/imorland/follow-users/pull/33/files

This issue is reproducible with just flarum/core, fof/follow tags & ianm/follow-users (the joined at date will initially always say "joined a few seconds ago"). The issue is more noticeable when data of other extensions are missing (such as fof/best-answer).

Using BasicUserSerializer (before):

Screenshot 2024-07-15 at 14 27 26

Using UserSerializer (after):

Screenshot 2024-07-15 at 14 26 38

This will impact performance, but I think it's unavoidable to switch the Serializer.