- Affected version
- 2.0.12
If the first poster of a thread has no session activity, a redundant query will be done when checking
This is because the user entity is created in the thread query, which does not query for session activity. The post query does, but because the user entity is already loaded, it just grabs that. This user entity does not have a Activity relationship entry in it's
(snapshot of loading a Post, which has a user loaded by a Thread)
Generic reproduce steps;
isOnline()
for that post.This is because the user entity is created in the thread query, which does not query for session activity. The post query does, but because the user entity is already loaded, it just grabs that. This user entity does not have a Activity relationship entry in it's
relations
array.hydrateFromGrouped
does not appear to populate the _relations field for an existing entry, even if relations are loaded. This works because instantiateEntity
will record a positive lookup. However instantiateEntity
does not populate entities
with nulls, this results in an extra query when that known-empty relationship is later accessed.(snapshot of loading a Post, which has a user loaded by a Thread)
Generic reproduce steps;
- Load a entity in query 1 with no relationships selected.
- Load that entity again in another query with relationships that are null.
- Access the relationships which should null values
- Observe extra unexpected queries
Last edited: