User tests: Successful: Unsuccessful:
Pull Request for Issue #20698
Better alternative to the closed PR #20697, @mbabker , i hope it is ok to ping you to review this
Modified method __wakeup() (class Joomla\CMS\User\User)
-- which is called when unserialize() is called on the JUser object
so that it does not reload user record from DB
Show only 2 duplicates queries
6 duplicates queries are reported
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Rel_Number | 0 | ⇒ | 14440 |
Relation Type | ⇒ | Related to |
Thanks anyone spending time on this,
anyway this is not needed
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-07-16 05:37:51 |
Closed_By | ⇒ | ggppdk |
Again, I don't think we absolutely need to remove these duplicate queries. What is the real issue it is trying to address, other than having multiple of the same query being executed in one cycle? We do a partial serialization of the User object (only the ID), so when unserialized the rest of the data has to be pulled in somehow. The User object is a data object representing a record from the database, any time it is instantiated (which includes the unserialization process) it really should be fresh data.
Duplicate queries in and of themselves are not a bug or concern. Why you have duplicates is more important. I don't really see "reading user data out of the session into a User object creates duplicate queries" as a concern and I honestly think if we're going to strive for a "no duplicate queries ever" policy we're going to introduce some bad code to the CMS.