Ember Object Discrepancy between Initial Page-Load and Hard-Refresh

AI 生成的摘要

In the Dev category, user ivanrlio reports a discrepancy where the posters attribute is present in the Ember object on initial page-load but disappears upon hard-refreshing. They provided screenshots illustrating that the sidebar, which relies on this data, becomes non-functional after a refresh. sam suggests the issue stems from a serializer or cache difference, noting that the attribute likely appears when loading from the topic list but is empty when navigating directly to a topic. Sam explains that adding a query to include this data in the serialization is not ideal as it is not typically surfaced, but remains open to allowing plugins to opt-in for this additional information.

On our site we’re generating a sidebar that will contain information about the topic such as posters, suggested discussions etc. An issue that I’ve noticed, at least for the attribute posters, is that upon initial page-load, it is present on the ember object. Upon hard-refreshing however, this attribute disappears and thus renders the sidebar rather pointless. Below are the screenshots of these instances.


Page-load Ember Object:



Hard-refresh Ember Object:


Would anyone be able to explain why this is occurring? Thanks

Most likely a discrepancy in the serializer/cache, first time around it is probably coming from the topic list. I bet that if you just have a link to a topic in a topic and visit via that it is empty as well.

Fixing this would add a query to topic serialization which is not super desired for information we never surface… open to allowing the plugin to opt-in for more information via the serializer.