Commit graph

118 commits

Author SHA1 Message Date
Aleksander Machniak
4136938a7a Don't store invalid objects in cache
For example, before the change it was possible to end up with
a task object in a calendar folder cache.
2019-05-16 08:33:27 +00:00
Aleksander Machniak
e848de3129 Use INSERT ... ON DUPLICATE KEY UPDATE in kolab cache
Bifrost#T61987
2018-12-28 14:13:25 +00:00
Aleksander Machniak
47f7793ac0 Slim down kolab cache (drop xml column, change data format) (Bifrost#T61991) 2018-12-27 14:26:35 +00:00
Aleksander Machniak
a90d4c6015 Fast-mode for events/tasks/contacts and some code improvements 2018-12-21 12:23:41 +01:00
Aleksander Machniak
28932e4c92 Fast-mode for selecting kolab objects
... for now used only by kolab_notes plugin
2018-12-13 18:36:17 +00:00
Aleksander Machniak
be749b2795 Add possibility to bypass indexes cache only 2018-12-13 16:27:06 +00:00
Aleksander Machniak
67f6ef9bbf Always fetch xml from IMAP and parse objects on select
Temporarily we still store data and xml as before, but do not use them on select.
2018-12-19 12:25:39 +01:00
Aleksander Machniak
011fa7949d Add support for prefix search in kolab cache 2017-07-19 12:54:47 +02:00
Aleksander Machniak
45ce87f545 Remove duplicates on cache synchronization.
https://issues.kolab.org/show_bug.cgi?id=4067 and (Bifrost#TT20881)

It happens that IMAP folder may contain many objects with the same UID.
The precise reason for this is unknown, but it can be e.g. a faulty
client or an error between "create a new object instance" and "remove the
old one". It causes various issues when editing such objects.

With the change we assume that the most recent object (with max. IMAP UID)
is the one that should be used and all the older instances will be removed
automatically.
2017-02-16 12:49:11 +01:00
Aleksander Machniak
d6ea9104ba Fix "unknown" dates in event dialog (Bifrost#T21544) 2017-01-20 10:38:21 +01:00
Aleksander Machniak
9d883ed07d Properly set skip_deleted and threading on Kolab storage IMAP operations (T1145)
Summary:
Fixes race-conditions between Kolab folders and Roundcube core
where skip_deleted/threading could be set for operations outside
of Kolab plugins, causing e.g. inability to see \Deleted messages.

Fixes T1145.

Reviewers: #roundcube_kolab_plugins_developers, vanmeeuwen

Reviewed By: #roundcube_kolab_plugins_developers, vanmeeuwen

Maniphest Tasks: T1145

Differential Revision: https://git.kolab.org/D112
2016-04-14 11:42:00 +02:00
Aleksander Machniak
9daf32495a Fix regression in get_object() (T1098)
Also remove the second argument as it was useless.
2016-03-07 17:54:01 +01:00
Aleksander Machniak
6c25221b95 Performance: Make objects moving faster (less SQL and less IMAP operations) using COPYUID 2016-02-24 13:57:58 +01:00
Aleksander Machniak
11ce37ef17 Performance: Limit number of SQL queries when "attaching" relations/tags to list of tasks/notes (#3969) 2016-02-13 17:35:29 +01:00
Aleksander Machniak
52053f355a Performance: Optimize kolab_storage_folder::get_object() to use one sql query instead of two
Before the change to get an object by UID we first resolve UID to IMAP-UID
and then fetch the object data by IMAP-UID - two select queries. Now we
directly select the data by UID.
2016-02-13 11:33:01 +01:00
Aleksander Machniak
d2f74ee9fa Performance: Skip SELECT query if we already know it will return no records (from previous SELECT COUNT(*)) 2015-08-27 14:13:36 +02:00
Aleksander Machniak
a0ca17fb36 Fix missing events on edges of the view time range (when client timezone is different than server tz) (T698) 2015-08-18 12:39:55 +02:00
Thomas Bruederli
39449c11ce Improve groupware object cache synchronization (#3933):
- store and compare the number of objects stored after last sync
- use a (configurable) refresh interval and periodically force re-sync

ATTENTION: requires database schema updates
2015-02-05 15:27:28 +01:00
Thomas Bruederli
29645a4736 Fix db table reference; forward constructor argument (#4471) 2015-02-03 17:26:03 +01:00
Thomas Bruederli
948a68136d Handle possible errors from kolab_storage::get_folder() access (#4378) 2015-02-03 16:30:02 +01:00
Thomas Bruederli
5982ce8732 Add error checking/reporting facilities to kolab_storage_folder instances (#4378) 2015-02-03 13:15:56 +01:00
Thomas Bruederli
038e269d51 Check (expected) folder type and disable access to folder contents or cache if invalid (#4378) 2015-01-29 16:48:42 +01:00
Thomas Bruederli
af216b50e3 Improve sync lock setting/reading to avoid race conditions (#4316) 2015-01-23 14:43:45 +01:00
Aleksander Machniak
bfe6de5b54 Remove redundant updating of uid2msg map in synchronize() 2015-01-12 10:30:50 +01:00
Aleksander Machniak
ac4f6e7562 Avoid unused variables (also fixed some bugs) found in static code analysis 2014-11-21 10:03:18 +01:00
Thomas Bruederli
8627b72357 Avoid hitting executing time limit when synchronizing cache (#3677):
This change will make the synchronization process abort before the time limit is reached.
The folder is not flagged as fully synchronized and subsequent requests will continue the synchronization.
Application scripts can read the public 'sync_complete' property and initiate a next sync request.
2014-11-04 13:04:57 +01:00
Thomas Bruederli
a3d5f717a2 Fix moving events to another calendar/folder and reloading it (#3748) 2014-10-09 16:37:31 +02:00
Aleksander Machniak
fbe1759c00 Skip multifolder insert for Oracle, we can't put long data inline 2014-09-18 15:24:16 +02:00
Aleksander Machniak
e9e871a43f Quote columns in ORDER BY 2014-09-17 19:50:26 +02:00
Aleksander Machniak
9e49c5c83b Quote also column aliases in sql tables, otherwise they will be returned uppercase in Oracle 2014-09-17 18:06:17 +02:00
Aleksander Machniak
788635b287 Use consistent column/table quoting in sql queries 2014-09-15 12:23:46 +02:00
Thomas Bruederli
54b6eb66de Post-filter all tag objects (in case caching is disabled); improve kolab_storage_cache for the case caching is off 2014-08-26 12:03:11 +02:00
Thomas Bruederli
a9805a9063 Don't break kolab_storage_cache::select() return data if reading one single cache entry fails 2014-08-21 10:29:12 +02:00
Aleksander Machniak
a9f8715248 Fix caching configuration objects 2014-07-30 10:53:30 -04:00
Thomas Bruederli
18a106538b Return the most recent message UID in case there are duplicates 2014-07-07 12:23:47 +02:00
Thomas Bruederli
24a6821749 Resolve UID -> MSGUID mapping from cache table index instead of using IMAP search 2014-04-01 16:32:28 +02:00
Thomas Bruederli
44088f37e6 Fix cache queries for ['tags','!=','x-complete'] 2014-03-17 13:16:10 +01:00
Aleksander Machniak
9f7cd83f92 Make 3rd argument of kolab_storage_cache::save() really optional (Bug #2863) 2014-02-25 10:47:10 +01:00
Thomas Bruederli
af6d366a1f Optimize access to kolab contacts using a sorted and limited query (#2828)
- Add columns for sorting in kolab_cache_contact
- Extend bin/modcache.sh script to update existing cache records
- Add setters for ORDER BY and LIMIT clauses
- Adapt the kolab_addressbook plugin to fetch contacts page-wise

ATTENTION: This changeset contains database schema changes!
Run `bin/updatedb.sh --dir plugins/libkolab/SQL --package libkolab`

Afterwards, the cached data needs to be updated. To do so, either run
  `plugins/libkolab/bin/modcache.sh update --type=contact`
or execute the following query
  DELETE FROM `kolab_folders` WHERE `type`='contact';
2014-02-10 11:46:50 +01:00
Thomas Bruederli
acbd45001c Return null on error for UID queries (to remain backwards compatible) 2014-02-10 11:39:24 +01:00
Thomas Bruederli
22a1c7a7ee Don't set error state on simple arrays; simplify query 2014-02-10 09:27:16 +01:00
Thomas Bruederli
816356813c Save error state in kolab_storage_cache::select() return value 2014-02-10 08:51:51 +01:00
Thomas Bruederli
98741574d9 Always return a valid array/iterator 2014-02-07 13:24:11 +01:00
Thomas Bruederli
2ade247a0c Return a kolab_storage_dataset itertor object from kolab_storage_cache::select()
to manage memory usage for large result sets (#2828).

Attention!
Do not cast the return value of kolab_storage_folder::select() calls into an array anymore.
2014-02-06 17:25:16 +01:00
Thomas Bruederli
965a9b74b3 Fix anually recurrence end date on 32bit systems by replacing (overflowing) unix timestamps with DateTime objects (#2613) 2014-01-22 11:22:23 +01:00
Aleksander Machniak
05003d0596 Fixes/improvements for use with kolab_cache=false 2014-01-07 16:28:06 +01:00
Thomas Bruederli
229d31e90e Avoid fatal errors if folder type information is missing (#1321) 2014-01-06 17:08:26 +01:00
Aleksander Machniak
b1e824becf Added error handling in select() and count(), so on error they will return null 2014-01-02 13:37:39 +01:00
Aleksander Machniak
a7c4ebf15d Fix kolab cache issues with malformed/unsupported character sequences
being stored in data, xml and words columns, which caused malformed
(and inaccessible) objects (Bug #1912, #2662)
2013-12-12 09:45:18 +01:00
Thomas Bruederli
158fa06a3c Fix moving of Kolab objects to other folders in cache (#2564) 2013-11-20 17:17:31 +01:00