6.0.0-alpha10
5/14/25

Search Results: 411 of 573 [ <<First <Prev Next> Last>> ] [ Return to Search Results ]


[#12510] Driver: $_count cache gets dirty on modifications
Summary Driver: $_count cache gets dirty on modifications
Queue Turba
Queue Version Git master
Type Enhancement
State Feedback
Priority 1. Low
Owners
Requester thomas.jarosch (at) intra2net (dot) com
Created 07/29/2013 (4307 days ago)
Due
Updated 07/30/2013 (4306 days ago)
Assigned 07/29/2013 (4307 days ago)
Resolved
Milestone
Patch No

History
07/30/2013 07:43:22 AM Thomas Jarosch Comment #5 Reply to this comment
In fact grepping the code for "->count()" shows it's not used at all 
(-> not exported by the API). Could we also just remove / deprecate 
it?
Ok, forget about that: It works through the "Countable" mechanism
and is used by View/Browse.php only. Does not seem to be exported by the API.

I can take a look at this, though it's really low priority.
Let's get Kolab and ActiveSync playing nicely together first :)

07/30/2013 07:33:42 AM Thomas Jarosch Comment #4 Reply to this comment
The value of this only lasts for a single request, and is never 
called after a modification takes place in the same request.

However, these are the types of things that can later cause a 
headache trying to track down if this behavior ever changes. So if 
you provide a patch, I agree it should be committed.
In fact grepping the code for "->count()" shows it's not used at all 
(-> not exported by the API). Could we also just remove / deprecate it?

The real counting stuff in done in Turba_List.

07/29/2013 10:15:26 PM Michael Rubinsky Comment #3
Type ⇒ Enhancement
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
Changing type: There is no broken behavior.
07/29/2013 10:14:05 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
The value of this only lasts for a single request, and is never called 
after a modification takes place in the same request.

However, these are the types of things that can later cause a headache 
trying to track down if this behavior ever changes. So if you provide 
a patch, I agree it should be committed.
07/29/2013 01:47:47 PM Thomas Jarosch Summary ⇒ Driver: $_count cache gets dirty on modifications
 
07/29/2013 01:44:46 PM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Driver: $_count cache gets dirty on modifcations
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hi,

while reading through the Turba driver code, I've noticed
there is an internal cache for the total count of contacts: $_count.

A generic count() implementation is in lib/Driver.php and a more specific
one for SQL in lib/Driver/Sql.php.

IMHO we should reset (=unset) the count cache in 
lib/Driver/Sql.php:_add(), _delete() and _deleteAll().
Is the owner allowed to change in _save()? Then _modify() would be 
affected, too.
Same goes for the generic count function.

Cheers,
Thomas

Saved Queries