fix: switch to UserSerializer
for followedUsers
relationship
#39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/filesThis 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
![Screenshot 2024-07-15 at 14 27 26](https://private-user-images.githubusercontent.com/146922689/348704548-c97e02e8-bede-4fda-8bcb-35b7a0afdcb8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDkyMDMsIm5iZiI6MTczOTI0ODkwMywicGF0aCI6Ii8xNDY5MjI2ODkvMzQ4NzA0NTQ4LWM5N2UwMmU4LWJlZGUtNGZkYS04YmNiLTM1YjdhMGFmZGNiOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwNDQxNDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00MTEzZWIxMTljOWZiNGIzODQxMGM2YTNhNmUzY2Q3MGYxNmY5ZDcxOTVlZTdjOGYyZDY1ODcwNTRkMjdhMDc2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ZvXUE3fJsjGSGxh-ZuUWgmNnUFxw7WSuk88Es4B06Rk)
BasicUserSerializer
(before):Using
![Screenshot 2024-07-15 at 14 26 38](https://private-user-images.githubusercontent.com/146922689/348704655-147a8fab-d81b-4ef7-88f5-b304ac3ff86e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDkyMDMsIm5iZiI6MTczOTI0ODkwMywicGF0aCI6Ii8xNDY5MjI2ODkvMzQ4NzA0NjU1LTE0N2E4ZmFiLWQ4MWItNGVmNy04OGY1LWIzMDRhYzNmZjg2ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwNDQxNDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZTk3NDNlNjA2Yzc1NzhmMmQ1ZGI2NmRmNWFkMzE5ODRhZjc0Y2I4M2NlYzVkMGY2NDI2M2NiZDhiNjg3YzY4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.kMDJsgY0FMDsRev24PukOUHiIOI2i3ZtH9KCz-5sbr0)
UserSerializer
(after):This will impact performance, but I think it's unavoidable to switch the Serializer.