Commit Graph

72 Commits

Author SHA1 Message Date
Richard Newman
1a09c9f570 Bug 664865 - More considered handling of node reassignment mid-sync. r=philikon 2011-06-25 14:54:50 +01:00
Philipp von Weitershausen
3c999d08f0 Bug 661587 - Don't use the root logger. r=rnewman 2011-06-13 20:42:18 +02:00
Philipp von Weitershausen
e198b5205d Bug 662178 - Simplify timed callbacks. r=rnewman 2011-06-06 21:27:36 +02:00
Richard Newman
7c1133a97f Move Resource.serverTime to AsyncResource, fix comments for AsyncResource. r=philiKON 2011-05-30 19:01:25 -07:00
Richard Newman
eee2107d91 Move async utilities into async.js. Add Async.makeSpinningCallback as a temporary shim for wrapping Cb versions of functions. r=philiKON 2011-05-30 19:01:13 -07:00
Richard Newman
88c452c9ae Bug 656708: Channel.URI is undefined. r=philiKON 2011-05-30 14:21:03 -07:00
Philipp von Weitershausen
15a24d71c1 Bug 648364 - Remove dead code. r=rnewman 2011-05-19 18:09:02 -07:00
Philipp von Weitershausen
bf1271b21a Bug 648364 - Replace custom helpers with XPCOMUtils.jsm. r=rnewman 2011-05-19 18:08:35 -07:00
Philipp von Weitershausen
a85e5bfc44 Bug 648364 - Replace custom helpers with Services.jsm. r=rnewman 2011-05-19 18:08:07 -07:00
Richard Newman
f91d29f16b Bug 652182: eliminate Resource status == 0 check missed in landing of Bug 623080. r=philiKON 2011-04-22 12:13:17 -07:00
Richard Newman
f8b9e1f2dc Bug 568156: more Sync UA tweaks. r=philiKON 2011-04-08 13:43:38 -07:00
Richard Newman
a76ea032e7 Bug 568156: Use Sync client version as User-Agent. r=philiKON 2011-04-07 13:55:02 -07:00
Richard Newman
7f62848b0f Bug 623836: part 1: use lowercase headers where we're supposed to. r=philiKON 2011-04-06 16:12:21 -07:00
Richard Newman
8080d25248 Bug 623080: make Resource more loggy and robust. r=mconnor 2011-04-01 15:27:19 -07:00
Richard Newman
c35f80cda9 Bug 623836: part 0: simplify Resource.setHeader. r=philiKON 2011-03-30 18:28:56 -07:00
Philipp von Weitershausen
1a4b88fb4e Bug 636402 - Simplify Sync.js to avoid creating new objects. r=rnewman a=blocking-fennec 2011-02-25 14:43:18 -08:00
Philipp von Weitershausen
aae4881a79 Bug 591102 - Ensure exceptions from [Async]Resource contain the status code. r=mconnor 2011-01-31 20:55:48 -08:00
Philipp von Weitershausen
ae612b75dd Bug 609421 - Combine auth.js and resource.js. r=rnewman 2011-01-18 16:23:38 -08:00
Richard Newman
3f4146ba5f Bug 624019: log exceptions, not just their stacktrace, in onDataAvailable. r=philiKON 2011-01-07 14:30:16 -08:00
Richard Newman
c9a23f8fc5 Bug 622760: log exceptions thrown in _onProgress callbacks. r=philiKON 2011-01-04 16:27:00 -08:00
Richard Newman
a108a4e85b Bug 619162: default resource success is false; retry once. r=philiKON 2010-12-20 12:47:51 -08:00
Philipp von Weitershausen
772cdce99c Bug 603301 - Add async resource API. [r=mconnor]
The async API is exposed as AsyncResource which is functionally equivalent to Resource.
The latter is now a wrapper around AsyncResource.
2010-10-29 10:20:27 -07:00
Philipp von Weitershausen
dd802fcf47 Bug 580672 - Implement quota UI (Part 1) [r=mconnor]
Recognize quota warnings from server, implement API calls to retrieve quota information.
2010-09-11 18:39:21 +02:00
Edward Lee
0cbfa6f197 Bug 570636 - Decide how to co-exist as a sync add-on and built-in sync [r=mconnor]
Map the modules directory to services-sync instead of weave and update imports.
2010-06-16 14:30:08 -07:00
Edward Lee
bffd21b356 Bug 568136 - Migration requires client to check for a node again after a 401 [r=mconnor]
Allow observers to watch for resource 401s and to specify a new uri to request. Test to make sure "weave:resource:status:401" gets notified and resource handles uri changes.
2010-06-03 18:37:07 -07:00
Philipp von Weitershausen
ada4345433 Bug 557596 - code audit and create unit test plan for resource.js [r=mconnor]
Lots of resource tests, Resource.serverTime initialized to null, Resource.headers normalized to lowercase.
2010-06-01 15:15:53 -07:00
Edward Lee
12f3abb6e4 Bug 560184 - Proxy authentication: Initial Weave connection attempt doesn't time out [r=mconnor]
Delay the abort timer from the constructor in addition to onStartRequest and onDataAvailable in-case the callbacks never get called.

--HG--
extra : rebase_source : 1243f3baa468b13f8da28175b10aa99b2341e53a
2010-04-21 11:10:21 -07:00
Edward Lee
084907c53f Bug 550627 - Default reconciliation to server wins for older changed items [r=mconnor]
Save the time the tracker adds a new changed id and use that to compare the age of the record on the server vs the age of the local change to decide if it's server wins or client wins. Fix up various direct uses of changedIDs to use the API and make the save-to-disk lazy to avoid excessive writes. Add a test to make sure addChangedID only increases in time.
2010-04-01 15:54:53 -07:00
Edward Lee
cc452bb5e2 Bug 544532 - Weave won't sync after resume from standby [r=mconnor]
Start an abortTimer onStartRequest and refresh the timer on each onDataAvailable only to cancel on an onStopRequest. If the timer triggers, the sync/async call will be aborted.
2010-04-01 15:25:47 -07:00
Edward Lee
8c4c90a45d Bug 545764 - Convert constructor -> _init pattern to just use constructor
Inline various _init calls and do super's init with <Super>.call(this, args..). Add various get/set sugar to those missing e.g., meta.keyring. Also simplify crypto record creation by setting cleartext in the parent.

--HG--
extra : rebase_source : 6c9a9f210f8f46ac338adb84188538e7353c9673
2010-02-11 15:25:31 -08:00
Edward Lee
5e3b42f790 Bug 535722 - Reduce the amount of logging for default log levels
Include the URI on success/fail requests and only trace log the onStartRequest. Switch various debug messages to trace and remove importing Log4Moz in fx-weave-overlay and generic-change. Drop the rootLogger to Debug to not log trace messages from unpreffed loggers.
2009-12-17 18:51:55 -08:00
Edward Lee
c0765fefde Remove trailing whitespace from the codebase. 2009-11-20 14:34:20 -08:00
Mike Connor
cc109400c6 bug 511549 - make detailedStatus much smarter about errors and backoff, r=edilee
--HG--
extra : rebase_source : 42e3eb9c89d2567d18c02e7583202e284dd69b0e
2009-09-15 21:38:52 -04:00
Edward Lee
345151e76f Chop off the end of long URIs for debug output onStartRequest. 2009-09-11 14:52:27 -07:00
Edward Lee
da76f65a99 Remove some unnecessary logs that follow right after the notify/event now that we only show verbose. Only log non-success response body for Trace. 2009-09-10 22:57:36 -07:00
Edward Lee
554e7266d1 Bug 515676 - Allow giving objects to PUT/POST without Filters to avoid stringify([parse(stringify(stringify(obj)))])
Get rid of Filters and automatically JSON.stringify PUT/POST data that aren't strings, so plain Records can be passed in to PUT and POST. This leverages toJSON of Records to provide an object that can be serialized. Fix up client record serialize/deserialize to still escape/unescape non-ASCII.
2009-09-10 11:05:13 -07:00
Edward Lee
4d5295d9ac Bug 515678 - Provide a smart getter to get the object representation of a JSON Resource response
Always allow getting an object representation of potentially JSON response for any Resource instead of explicitly on filterDownload. Update existing Resource GETs that manually parse the response. This prevents the String response from accidentally toString()ing a filteredDownload that converted to a different type.
2009-09-10 11:04:36 -07:00
Edward Lee
771c9805e7 Bug 511746 - Resource.foo shouldn't throw except in exceptional cases. r=thunder
Get rid of lastChannel and return a String object from _request with additional properties of status, succeeded, headers -- even if the response was handled by cache. Update engines to check for non-success and throw the failure. Update tests to use these additional properties instead of lastChannel, etc.
2009-08-26 15:32:46 -07:00
Edward Lee
852bb71758 Backed out changeset 129ca9a54aed due to burning
test_auth_manager:      FAIL
test_resource:  FAIL
2009-08-26 01:50:36 -07:00
Anant Narayanan
adf361843a Change Resource.get() semantics and support X-Weave-Alert (bug #478330)
--HG--
extra : rebase_source : e0eb1e34f85ddd041005d780590640005dc0b434
2009-08-26 00:05:57 -07:00
Edward Lee
bea7925a6b Bug 510152 - Check for failure onStopRequest and throw the error for extra debugging
Wrap the error code with a JS Error to track the stack, and re-wrap it to get the full stack trace. Also, remove args for __request for the stack because it's sometimes the whole record..
2009-08-12 20:28:46 -07:00
Edward Lee
ac355ae207 Bug 485573 - Fennec runs out of memory and crashes if too many history items to sync. r=thunder
Incrementally process records as the collection finds record boundaries and converts them to records for the engine to use. Get rid of the collection iterator and original RecordParser. Add tests for incremental record parsing and remove old iter tests.
2009-07-22 16:38:34 -07:00
Edward Lee
91eaad7a57 Debug log the size of PUT/POSTs messages.
--HG--
extra : rebase_source : 67a4e2afd1c908cc9184c0866226a55c77a96292
2009-07-14 13:59:46 -07:00
Edward Lee
a8ef74db89 Strip newline from various debug output. 2009-07-09 17:44:41 -07:00
Edward Lee
8fd525f317 merge weave. resolve comments added to resource.js. 2009-07-09 11:21:20 -07:00
Anant Narayanan
b8e79586eb Add some docs for Resource module 2009-06-25 16:13:52 -07:00
Edward Lee
c062ca590b Remove Async.sugar from auth.js, resource.js, stores.js, trackers.js. 2009-06-05 00:51:09 -07:00
Edward Lee
9944cd45ea Remove Sync(filterUpload/Download) and make them plain sync function as well as beforePUT and afterGET. 2009-06-04 22:10:41 -07:00
Edward Lee
5220bc6208 Change Resource.get() to be sync (no callback) and fix up call sites used for login + sync now. 2009-06-04 10:16:07 -07:00
Edward Lee
4a435195ca Switch Resource._request to Sync. (ChannelListener, filterUpload/Download) 2009-06-04 10:14:54 -07:00