6.0.0-git
2018-12-16

[#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 2013-07-29 (1966 days ago)
Due
Updated 2013-07-30 (1965 days ago)
Assigned 2013-07-29 (1966 days ago)
Resolved
Milestone
Patch No

History
2013-07-30 07:43:22 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 :)

2013-07-30 07:33:42 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.

2013-07-29 22:15:26 Michael Rubinsky Comment #3
Type ⇒ Enhancement
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
Changing type: There is no broken behavior.
2013-07-29 22:14:05 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.
2013-07-29 13:47:47 Thomas Jarosch Summary ⇒ Driver: $_count cache gets dirty on modifications
 
2013-07-29 13:44:46 Thomas Jarosch Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Driver: $_count cache gets dirty on modifcations
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
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