Commit Graph

147 Commits

Author SHA1 Message Date
Dan Mills
1883c83218 make sure to only save the last sync timestamp as a number 2009-02-18 20:17:30 -08:00
Dan Mills
a6a7141691 add a method for resetting the engine's lastSync pref 2009-02-17 13:20:02 -08:00
Dan Mills
a30d82e53d add '-engine' to engine name in observer notifications 2009-02-11 21:51:24 -08:00
Dan Mills
57c5368d7a remove sm-weave-proxy01 hack 2009-02-11 13:47:51 -08:00
Dan Mills
aafa72814f multi-cluster support; use new 'newer' flag instead of 'modified' for collection searches 2009-02-10 00:57:16 -08:00
Dan Mills
03d78b3d84 set record IDs inside the store; fix bookmarks tracker, it was ignoring change events (e.g., changed title and such) 2009-01-27 16:54:54 -08:00
Dan Mills
a47fcda5b1 only url-encode weave IDs when constructing a URL with them 2009-01-27 16:36:00 -08:00
Dan Mills
a3d9640e3c Make records not extend Resource, instead they have a serialize() method that can be used to create a Resource for uploading if necessary.
Use global service instances under Svc.*
Consolidate various record managers (caches/convenience factories) to extend the same base object
Log exceptions caught by notify wrapper
2009-01-27 13:35:10 -08:00
Dan Mills
84340dcdc2 cast modified timestamp to an int if it's a string 2009-01-21 19:02:38 -08:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
e823363952 Merged 2009-01-15 14:06:00 -08:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
cd797f05a7 Added a method to historyStore called tempTableExists which does a SELECT (rather than using tableExists) to correctly tell whether a temp table is there or not, so that historyEngine will work correctly on both Fennec and Firefox (See bug 472963) 2009-01-15 14:05:50 -08:00
Dan Mills
67f99f74cd add some extra log info to engine; have tracker ignore all changes when applying a change to prevent the tracker from generating new guids for new items before the store has a chance to set the right one 2009-01-14 22:01:04 -08:00
Dan Mills
445916b2e6 ignore/unignore specific weave IDs instead of a blanket enable/disable of the tracker during sync. 2009-01-13 14:43:21 -08:00
Dan Mills
cf5c78dfcf skip part of reconciliation for incoming deleted records 2009-01-08 21:33:37 -08:00
Dan Mills
c3dc0195a6 fail recordLike if either record is null (deleted) 2009-01-07 13:05:05 -08:00
Dan Mills
ff240dd3ce add clients sync (list of clients with names and types); make it simpler to create Engine subclasses; remove the 2nd 'authenticator' parameter for Resources; resetServer is now wipeServer; consider 0 an invalid place ID (fixes bug when calculating item depths); add a Svc global exported from utils.js where commonly used services can live 2009-01-06 13:54:18 -08:00
Dan Mills
34a114606d fix depth/index record generation 2009-01-02 21:13:32 -08:00
Dan Mills
cc914050b2 drop _isEqual debug statements to trace level 2009-01-02 17:35:47 -08:00
Dan Mills
41bd8b02b9 consider sortindex when checking if a remote record is the same as a local one 2009-01-02 17:27:45 -08:00
Dan Mills
4cb774d408 remove extra debug code 2009-01-02 16:17:36 -08:00
Dan Mills
2754039971 fix/further simplify reconciliation 2009-01-02 15:51:35 -08:00
Dan Mills
62c5aa360c remove 'outgoing' record cache (generate outgoing records at send time); clear the store cache and force a GC after reconciliation; push depth+index (metadata) records after regular (full) records; simplify + better comment reconciliation function; fix low mem check 2009-01-02 13:51:38 -08:00
Dan Mills
d04e52f8f5 typo fix 2008-12-30 23:56:53 -08:00
Dan Mills
5e3ac9586e add a generic cache class for storing records during reconciliation. cache has 100 item limit, and is cleared before and after reconciliation so the OS can reclaim memory after GC 2008-12-30 23:52:20 -08:00
Dan Mills
380b614133 make engine keep less records in memory by limiting the outgoing queue to a maximum of 100 records, and fetch the rest from the store each time 2008-12-29 23:28:17 -08:00
Dan Mills
6b260498e0 switch to generating individual bookmark records directly from the places store, without using a cache (to improve memory performance); create objects for bookmark types; temporarily disable history sync 2008-12-28 19:59:44 -08:00
Dan Mills
8a57024bf8 force GC, makes sync of many items possible on fennec 2008-12-26 21:49:17 -08:00
Dan Mills
aff056726e change serverURL to use 0.3 url schema 2008-12-23 13:51:30 -08:00
Dan Mills
62a45ad0ab Various engine/bookmark changes:
* Rely on the server to sort incoming records, remove all sorting code client-side.
* Streamline sync to be able to process incoming records one at a time, as soon as they are downloaded.  This changes reconciliation to be able to process a single incoming record.
* Engine base class will automatically convert parentid, depth, and sortindex into toplevel WBO objects.  This is good for now but kinda broken, engine subclasses should really be generating WBO records themselves.
* Since index is now a toplevel WBO property, there is no need for the bookmarks sync code to subclass recordLike.
* Refactor bookmarks store to be a little cleaner and work directly with records instead of "commands".
2008-12-23 11:30:31 -08:00
Dan Mills
08512b99a5 change engine to process (download, reconcile, apply changes) incoming records one by one 2008-12-19 11:48:09 -08:00
Dan Mills
d55df6a1f4 implement the awe (or tears) inducing places-style sql queries -- history sync works pretty well now 2008-12-18 22:39:32 -08:00
Dan Mills
1e7370ba2d don't stop applying changes when one fails to do so 2008-12-12 13:53:48 -08:00
Dan Mills
3ef1c0d9b1 enable history sync (not working yet) 2008-12-09 12:26:14 -08:00
Dan Mills
f2e4594263 make changeItemID exclusively a store method 2008-12-08 13:21:25 -08:00
Dan Mills
9070a62677 remove sync cores, they are no longer used; remove sharing code from bookmarks (we can bring it back when we need it again, needs work); have the engine give hints to the store about when to wrap all items and cache them (to make subsequent calls to wrap one item fast); move serializeItem/getAllIDs into the store 2008-12-08 09:53:32 -08:00
Dan Mills
c595ceeb1b clear changed IDs before adding all current ones in first-sync case; edit the ID list directly instead of enabling/disabling the tracker 2008-12-06 00:08:54 -08:00
Dan Mills
f1332902ba parentGUID -> parentid 2008-12-05 03:36:27 -08:00
Dan Mills
37a62b2479 re-enable tracker in the first-sync case just to add all the guids; add some debugging messages; when reconciling throw out records which are identical on the client and server (even if we thought they had changed) 2008-12-05 03:28:17 -08:00
Dan Mills
fd7d30a288 oops, always disable tracker during sync 2008-12-05 00:58:25 -08:00
Dan Mills
95b8e357b2 disable tracker for entire sync run. make sure tracker is re-enabled at the end 2008-12-05 00:55:19 -08:00
Dan Mills
c1a443df70 use callbacks instead of snapshot diffs to figure out what changes to send to the server 2008-12-05 00:39:54 -08:00
Dan Mills
a67aabffa4 add logic to detect when the same item is in both incoming & outgoing queues, but with different IDs - change the local ID in that case 2008-11-27 00:25:28 +09:00
Dan Mills
c221d2ea8e decrypt incoming items all in one go so as to sort them by index (which is inside the payload); don't attempt to change the index of an item if we're also changing its folder; only change index/parent if it's different from current value 2008-11-26 14:07:18 +09:00
Dan Mills
63f0615496 comment depth function for clarity, remove incorrect warning 2008-11-25 16:37:19 +09:00
Dan Mills
82dda0e367 sort incoming records by depth, so that folders are created before their containing items 2008-11-25 16:12:00 +09:00
Dan Mills
fbbdb6c964 use the new modified property returned after a server POST 2008-11-25 14:48:22 +09:00
Dan Mills
e5c9923591 add some debug chatter 2008-11-25 01:48:38 +09:00
Dan Mills
409940f099 clean up sync function, get last timestamp properly from post result, save correct snapshot at the end, only attempt to post changes to server if there are any changes at all 2008-11-25 01:04:14 +09:00
Dan Mills
5b84631f1a enable batch upload, yay! 2008-11-20 10:38:53 +09:00
Dan Mills
48b9bd885e more NewEngine impl 2008-11-20 09:20:25 +09:00