discourse/app
Alan Guo Xiang Tan 2032d3c2fb
PERF: Preload user information when visiting user messages routes (#21929)
What is the problem?

The user messages routes are currently routed by the server to
`UserActionsController#private_messages`. However, the method is
essentially a no-op and does not do any preloading. As a result, when we
load the user private messages routes, the client ends up having to
issue another request to the server to get more information about the
user profile currently being viewed. This extra request is triggered by
the `user` model's `findDetails` method that is called from the `user`
route in the `afterModel` hook.

What is the solution?

The `user` model's `findDetails` method actually checks the preload
store to see if the `user_${username}` key is present in the store and
if it is, it will use the preloaded data instead of triggering another
request. Since the user private messages routes are nested under the
user route on the client side, we have to rely on the
`UsersController#show` controller action on the server side for the user private
messages route as the `UsersController#show` controller action preloads
the required user information for the client side.
2023-06-05 19:24:22 +08:00
..
assets FIX: simplify review community section link (#21907) 2023-06-05 11:25:29 +08:00
controllers PERF: Preload user information when visiting user messages routes (#21929) 2023-06-05 19:24:22 +08:00
helpers UX: Improve login required page (#20847) 2023-03-28 07:09:44 -05:00
jobs FIX: consider users.created_at for inactive cleanup (#21688) 2023-05-23 13:41:23 +05:30
mailers FIX: Likes received count in digest email (#21458) 2023-05-09 19:19:26 +02:00
models FEATURE: API Scope for latest.rss feed (#21906) 2023-06-02 08:28:14 -06:00
serializers FEATURE: Allow expanding hidden posts for groups in SiteSetting.can_see_hidden_post (#21853) 2023-06-01 11:32:05 +08:00
services DEV: Allow plugins to hook into user preferences update process on the server (#21737) 2023-05-26 03:26:38 +03:00
views FEATURE: Serve RTL versions of admin and plugins CSS bundles for RTL locales (#21876) 2023-06-01 05:27:11 +03:00