In the context of the “Getting data for the widget” discussion, Stranik is seeking an alternative method to retrieve the time_read variable, currently obtained through a JSON API call.
Stranik mentions that the currentUser object does not contain this data and that no data is transmitted through the {{plugin-outlet}} template.
gdpelican suggests adding recent_time_read to the serialized current user fields using DiscoursePluginRegistry.serialized_current_user_fields << 'recent_time_read'. This allows access to the data through User.current().recent_time_read.
However, Stranik notes that this method may not be suitable and seeks a more efficient approach to query for the data directly with minimal load.
Keep in mind that this will only be serialized once, on app load, and that to get an updated value you’ll either need to query for it directly, or use MessageBus to ‘live update’ the user’s read_time.