Commit Graph

488 Commits

Author SHA1 Message Date
Atul Varma
f9a93ee91d Added more fake prefs to the password test to eliminate strict warnings, added logging code to identity.js to aid in debugging. 2008-06-19 16:03:42 -07:00
Justin Dolske
e8e2bce2ce Fix reference to undefined function and bad async arg. 2008-06-19 15:36:24 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
603b5e26ba Fixed some more missing commas that were preventing engines/bookmarks.js from loading 2008-06-19 15:25:25 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
92c242b8df Added missing comma after function definition 2008-06-19 15:23:01 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
ab9f0aa2bb Backed out changeset 7720a1dd564a because the new crypto stuff that it uses hasn't been enabled yet. 2008-06-19 11:59:52 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
69da8061fb Applied dolske's patch from bug 433949 to make the bookmarkEngine work with the new improved Crypto interface. 2008-06-19 11:41:57 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
5f7b9953fd merged 2008-06-19 10:51:54 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
f02bb1638d Reimplemented most of _updateIncomingShare to work with the new implementation of _updateOutgoingShare. No more need for the ugly hack to temporarily set the root directory of DAV, hooray 2008-06-18 23:27:48 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
52fd203c7d Implemented _stopOutgoingShare (though it's still not being called from anywhere). 2008-06-18 23:00:09 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
5524c106b5 Added documentation to createIncomingShare, rewrote it a little to be consistent with the other new stuff, and made it use annotations to keep track of the server path to the shared data. 2008-06-18 22:37:06 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
f2d0ad6ab6 Gave the bookmarksEngine a permanent (lazy-initialized) reference to the annotation service, rather than recreating the reference every single time we use the service. Which is a lot of times now. 2008-06-18 20:53:11 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
080ec435c2 Implemented _updateAllOutgoingShares in bookmarkEngine. 2008-06-18 20:45:01 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
fd658ea35e Removed an unneeded yield statement from startXmppClient (this was raising warnings about yeilding without a callback.) 2008-06-18 18:48:17 -07:00
Atul Varma
6c09312d2a Replaced boilerplate XPCOM code with calls to util.js functions. 2008-06-18 18:04:01 -07:00
Atul Varma
8f20b9b0d9 Automated merge with http://hg.mozilla.org/labs/weave 2008-06-18 17:28:38 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
6f0992239d Turned all remaining dump()s in transportLayer.js into Log4Moz debug calls. 2008-06-18 17:23:04 -07:00
Atul Varma
6e83ffc460 Added a new property to async.js, Async.outstandingGenerators, which returns the number of generators that haven't yet been finalized. This can be used for diagnostic purposes to determine whether generators haven't yet been called back. 2008-06-18 16:11:15 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
bdff709f9e Imported Log4Moz to xmpp/transportLayer.js and xmpp/authenticationLayer.js, so they're no longer raising errors about Log4Moz being undefined (oops, sorry, should have tested before pushing.) 2008-06-18 14:59:06 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
4895e6e665 Merged 2008-06-18 14:53:30 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
39e5ae9520 XMPPClient sends its debugging output to log4moz (mostly debug level) now instead of dump, so it's less annoyingly verbose. 2008-06-18 14:50:02 -07:00
Atul Varma
7809c95d7d Refactored some file operations into a new function in Utils and out of engines.js. 2008-06-18 14:12:24 -07:00
Justin Dolske
f51c756491 You have: no tea. (Remove old TEA crypto support) 2008-06-18 13:25:58 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
78cac8373f The xmpp messages that are sent when a share is offered now include the server-side path to the share directory. 2008-06-18 13:16:32 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
229ebe76ae Merged 2008-06-18 12:48:26 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
797ac6aec0 made all calls to Resource.get() and Resource.put() properly asynchronous. 2008-06-18 12:48:20 -07:00
Atul Varma
e82cad86bc Fixed typos. 2008-06-18 12:45:02 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8d6a736f7a Removed the check of whether the directory exists before creating it, in _createOutgoingShare(): realized it's not neccessary since DAV.MKCOL already does it. 2008-06-18 12:41:34 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
e598f7db5b Merged 2008-06-18 12:32:52 -07:00
Atul Varma
25136833fc Replaced a bunch of boilerplate XPCOM with a call to Utils.makeTimerForCall(). 2008-06-18 12:32:20 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
65ba4ec4e7 Merged changes 2008-06-18 12:29:39 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
95c9d3d61e Added documentation to BookmarkEngine._updateOutgoingShare. 2008-06-18 12:29:25 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
249a68c1a7 Complete rewrite of _createOutgoingShare and _updateOutgoingShare in BookmarkEngine, using remote.Resource objects and Crypto. 2008-06-18 12:26:51 -07:00
Atul Varma
4267f258ce Removed an unused constructor parameter from PasswordEngine. 2008-06-18 12:04:49 -07:00
Atul Varma
b48aab609f Moved XPCOM-specific stuff from engines/passwords.js to util.js so they could be easily stubbed-out by unit tests. 2008-06-18 11:54:24 -07:00
Atul Varma
8181559fa4 Refactored test_service and module code so that the weave service constructor is called, and auth is done more accurately. 2008-06-17 19:54:09 -07:00
Atul Varma
89886c8e2e Fixed a minor typo, though there's a better way to do the unary getter which Myk told me about; will probably substitute that soon. 2008-06-17 11:11:56 -07:00
Atul Varma
4593669547 Added a fixme/todo in the code. 2008-06-17 10:23:35 -07:00
Dan Mills
2df246304e merge upstream changes 2008-06-17 18:04:16 +09:00
Dan Mills
747f38bb06 make RemoteStore a but more Store-like (wrap, wipe methods); fix a missing yield 2008-06-17 18:03:02 +09:00
Dan Mills
e82eb09a88 Don't allow re-entrance! Fail to lock when we already hold a lock. 2008-06-17 18:01:48 +09:00
Atul Varma
6826c19d20 Fixed a strict warning in util.js. 2008-06-16 18:11:41 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
9d0d519adc In the middle of trying to make createOutgoingShare work with Dan's changes (getSymKey having been moved to remote.js, etc.) 2008-06-16 17:52:24 -07:00
Dan Mills
e81712ba48 treat paths beginning with '/' as absolute 2008-06-17 09:51:02 +09:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
814b755255 Trying to debug _createOutgoingShare... 2008-06-16 15:52:15 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8b852636ee Merged 2008-06-16 11:24:41 -07:00
Dan Mills
e07d7c101f move more remote-interaction code into RemoteStore (and out of Engine) 2008-06-17 01:04:23 +09:00
Dan Mills
3ecee1a32e catch 404s from initSession and do an initial upload; fix some bugs (missing yields, references to Engine properties) in RemoteStore.initialize 2008-06-16 00:21:44 +09:00
Dan Mills
ba5e8762d2 merge upstream changes 2008-06-15 13:42:10 +09:00
Dan Mills
b9e5b182df merge upstream changes 2008-06-14 17:10:40 +09:00
Dan Mills
25f6da01d1 Move remote init code ('fullUpload') into RemoteStore; make RemoteStore hold an Engine object (tightly coupling them); make the server prefix and identity properties of Engine public 2008-06-14 17:07:06 +09:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
2092466c5f Merged 2008-06-13 16:22:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
351b7b4c82 Fixed some minor bugs -- the name of the incoming shared folder is parsed correctly, and xmppClient now catches bounce errors that were previously parsed as messages. 2008-06-13 16:20:43 -07:00
Atul Varma
0fb90163fb Fixed an 'outstanding callbacks' warning and simplified the code a tiny bit. 2008-06-13 15:39:06 -07:00
Myk Melez
f0482b56e3 use nsIXMLHttpRequest::mozBackgroundRequest instead of DummyAuthProvider to suppress authentication dialogs and ensure XMLHttpRequests succeed even when the window that originated the request goes away 2008-06-13 13:08:36 -07:00
Dan Mills
0c475dfe37 To avoid some async.js warnings: Turn some 'yield' calls into 'return' ones, and don't call 'self.cb' twice in a row when constructing event listeners for XHRs. 2008-06-13 15:49:18 +09:00
Dan Mills
266d18fda1 Make some 'debug' log calls into 'trace' ones. Use the frame formatter, which will remove long paths to extension dirs from the output. Don't warn about outstanding callbacks if we caught an exception from the generator. 2008-06-13 15:47:41 +09:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
b25663858a Merged 2008-06-12 17:35:57 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
3f2b6465d8 Made the initialization of the xmppClient an asynchronous call. This included modifying xmppClient.js so that connect() can be passed a callback function that will get called once the connection has succeeded or failed. For most of our purposes this is probably a better API than what we had before where you call waitForConnection() and it busy-waits until the connection has succeeded or failed. 2008-06-12 17:35:44 -07:00
Myk Melez
815dae2a85 work around XmlHttpRequest bug 317600 by pausing for a 0ms timeout before trying to log in 2008-06-12 16:23:59 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
9e6d103089 Merged changes. 2008-06-12 14:30:46 -07:00
Myk Melez
8194366c43 bug 410550: stop running scheduled sync when the user is not logged into weave 2008-06-12 12:36:58 -07:00
Atul Varma
b60c082c90 Changed some of the debug() logging statements I added a few commits ago into trace() statemetns b/c they were drowning the log. 2008-06-12 12:00:19 -07:00
Myk Melez
3087d30c1b only retrieve score once per engine when doing a scheduled sync, since retrieving the score can be a non-negligible cost for trackers that calculate the score on-demand (like the tab tracker) 2008-06-11 20:07:35 -07:00
Myk Melez
ca47e27d9b Automated merge with ssh://hg.mozilla.org/labs/weave/ 2008-06-11 20:00:59 -07:00
Myk Melez
7233ee2c14 don't sync tab entry IDs, which change with every session, to avoid generating edit commands for every tab on restart even when the tabs haven't actually changed 2008-06-11 20:00:48 -07:00
Atul Varma
56acc2b13b async.js now keeps track of how many outstanding callbacks it has and uses this information to log warnings about coroutines that may have yielded without an outstanding callback, and coroutines that may have finished while a callback is still outstanding. These are merely 'warnings' rather than certainties because this code assumes that there is a 1:1 correspondence between accesses to self.cb and yields, and also that self.cb's are actually passed to asynchronous functions. It'd be really cool if we could actually keep track of whether a callback got garbage collected before it was called or something, though I don't know how much it'd help in the end. 2008-06-11 19:19:16 -07:00
Atul Varma
be8fa61e49 Added a few log messages to hopefully make the debugging of generators easier. Also added an id component to generators, which is part of their name, to help distinguish between concurrent instances of the same generator function. The following debug output represents the new logging infomation:
--
Async.Generator	DEBUG	 runTestGenerator-0: self.cb generated at test_async_missing_yield.js:28
Async.Generator	DEBUG	 secondGen-1: self.cb generated at test_async_missing_yield.js:20
Async.Generator	DEBUG	 secondGen-1: done() called.
Async.Generator	DEBUG	 runTestGenerator-0: self.cb() called, resuming coroutine.
Async.Generator	DEBUG	 runTestGenerator-0: done() called.
Async.Generator	DEBUG	 secondGen-1: self.cb() called, resuming coroutine.
Async.Generator	DEBUG	 secondGen-1: done() called.
Async.Generator	ERROR	 Async method 'secondGen-1' is missing a 'yield' call (or called done() after being finalized)
--

As you can see, I've added log messages whenever the Generator's 'cb' property is accessed--this is almost guaranteed to be very close to a 'yield' statement, and therefore provides us with a decently accurate idea of where the generator 'stopped'.  We also log a message when the generator continues, and by doing so we get an idea of how the coroutines interleave.

Another idea I had was to actually match calls to self.cb with calls to 'yield' to automatically detect e.g. two yields in a row (which will ordinarily result in a generator 'hanging'), a generator exiting while a self.cb still hasn't been called, but I'm not sure what kinds of reprecussions it may have.
2008-06-11 18:58:30 -07:00
Myk Melez
b9bfc1ea31 numChanged should be the number of shared items whose data is different, not the same 2008-06-11 18:47:56 -07:00
Maria Emerson
4af7d05d92 bug 438033: implement a better first-run wizard process; r=myk 2008-06-11 17:56:02 -07:00
Myk Melez
5e916d02f2 bug 437529: yield after starting to put the status file to the server so we don't finalize the sync until the PUT request completes 2008-06-11 17:44:08 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
b047be1d6c Fixed Utils.prefs.getStringPref (should be getCharPref) 2008-06-11 15:43:12 -07:00
Myk Melez
2d0e404b20 resetting the score is not an asynchronous operation, so Service::_syncEngine shouldn't yield after calling it 2008-06-11 15:23:54 -07:00
Myk Melez
05138ca62c clarify wording in scheduled sync threshold debug statements 2008-06-11 14:16:03 -07:00
Myk Melez
b9cbb59a9e fix typo in recent checkin that broke appending deltas to the deltas file on the server 2008-06-11 14:14:04 -07:00
Myk Melez
4d6ca43c38 once sync thresholds reach 1 (the lowest possible value), leave them there until something changes and we sync 2008-06-11 13:50:47 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
9672201b26 Resolved merging conflicts to service.js. 2008-06-11 11:54:44 -07:00
jonathandicarlo@localhost
b308c467e5 Created preferences for xmpp connection info (server url, realm, username, password), and a preference to turn xmpp messaging on or off, and made BookmarkEngine._init() call startXmppClient when this preference is true. 2008-06-11 11:13:35 -07:00
jonathandicarlo@localhost
52089ca901 Expanded bookmarkEngine.share and added some more todos for the next round of functions to implement 2008-06-11 11:01:45 -07:00
Myk Melez
8239794199 merge 2008-06-11 10:41:57 -07:00
Myk Melez
995b8141d8 bug 430363: ignore remove commands when generating deltas for history so the deltas file on the server doesn't grow too large; r=thunder 2008-06-11 10:40:24 -07:00
Myk Melez
b8067a3a48 bug 434816: use a decreasing threshold algorithm for the periodic scheduled sync to make sure we eventually sync even small changes to data; r=thunder 2008-06-11 10:38:25 -07:00
Dan Mills
505b2aa8de merge upstream changes 2008-06-11 23:31:28 +09:00
Myk Melez
292cc1dc84 give Engine a public getter for its snapshot that TabTracker can access when generating a sync urgency score 2008-06-11 00:03:28 -07:00
Dan Mills
b3442a6e9e Various changes:
Engine/RemoteStore:
* Move code to make the engine remote directory into RemoteStore.
* Fix initSession call in Engine to properly use callback / call yield.
* Do not check '_getServerData' return status in _sync, we will use exceptions from RemoteStore instead.
* Move code to push a new delta into RemoteStore (appendDelta()).  Currently comments out code that forces a re-upload in cases where the server (engine) format version was different.  We may add this back later into RemoteStore (?).
* Note that this patch also removes the 'this._encryptionChanged' conditional, which I believe is currently useless (we never set it).
Service:
* When wiping the server (due to a server version mismatch), skip .htaccess files, since they are usually not user-modifiable.
2008-06-11 11:12:04 +09:00
Anant Narayanan
d9354ae9de Make sync service check score before syncing: bug #434816 (r=thunder) 2008-06-10 13:45:37 -07:00
Atul Varma
c040b0cc2f Refactoring: made a new function, Utils.makeTimerForCall(), which is used by test suites and async.js. 2008-06-09 19:30:11 -07:00
Atul Varma
fc4056ba01 Added modules/sharing.js, which provides access to the RESTful sharing API, and a unit test suite. The unit test suite is pretty heinous right now and should get a bit of refactoring. 2008-06-09 18:55:26 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
ff96529b7e Merged 2008-06-09 18:44:21 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
be8d8ca4df Fixed a couple of minor bugs that were preventing bookmark share from starting (like, i was skipping enabled engines instead of disabled engines... duhh) 2008-06-09 18:44:13 -07:00
Atul Varma
e578772f0b Fixed a bug that was causing failing unit tests using async.js to not properly report error conditions. 2008-06-09 18:40:30 -07:00
Atul Varma
9a50d3a029 Added a POST method to dav.js. 2008-06-09 17:36:54 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
f0b2f120ea Moved the writing of the outgoing-share annotation on the bookmark folder to BookmarkEngine._share, where it makes a lot more sense than it does in the share.js dialog-box code where it used to be. 2008-06-09 16:49:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
09185ac26b Fixed a couple minor bugs that were preventing bookmark engine from starting up properly 2008-06-09 16:19:58 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
def99000e2 Renamed bookmarkeEngine methods so they make more sense with the new sharing model, e.g. updateAllIncomingShares instead of syncMounts. 2008-06-09 15:27:09 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
b35a6930b7 Merged 2008-06-09 12:13:03 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
512d95591b The folder annotation for outgoing shared folders is now a string containing the username of the person the folder is being shared with. Also moved to using const strings in bookmark-menu-overlay.js. 2008-06-09 12:12:51 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8829030b84 Merged 2008-06-09 11:49:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
ea75f4df3a Fixed my code so that BookmarkEngine._sync() now works correctly to call Engine._sync() and BookmarkEngine.syncMounts(), asynchronously. Added in some TODO comments about what's going to happen in the next round of refactoring. 2008-06-09 11:48:52 -07:00
Atul Varma
e63f4ac16e Just added a few semicolons that js2-mode warned me about. 2008-06-09 09:45:55 -07:00
Atul Varma
0c65b8b3d6 Added a unit test suite for modules/async.js. 2008-06-06 21:40:30 -07:00
jonathandicarlo@localhost
5bb48d8dfa Added license block and explanatory comments to bookmarks.js 2008-06-06 19:28:01 -07:00
jonathandicarlo@localhost
a59f8a133c Made BookmarkEngine.sync() responsible for calling BookmarkEngine.syncMounts (to get the incoming shared bookmark folder contents), eliminating the FIXME that previously had this being called from special-case code in WeaveSvc.sync(). 2008-06-06 19:22:23 -07:00
Atul Varma
3e159040cb Merged changes. 2008-06-06 17:46:46 -07:00
Atul Varma
cdffb0e77e In async.js, renamed 'object' to 'thisArg', which makes the code clearer and easier to understand. 2008-06-06 17:46:34 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
e09c7116a8 Resolved conflicts with Chris's changes (to use the username, unhashed, as the name of the server-side sharing directory) 2008-06-06 17:43:15 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
11f8af5431 Moved _createShare and _share() from engines.js to BookmarkEngine class in engines/bookmarks.js. The identity of the folder to be shared is now passed from the share dialog box (share.xul) into BookmarkEngine._share(). 2008-06-06 17:33:44 -07:00
chris@h-194.office.mozilla.org
f500b95f11 - this check in will break everyone temporarily, as it involves the changes necessary to shift us from sha1(email) to usernames, and to enable sharing on the server.
- we are also changing the default preferences on the trunk to point to the new staging server at https://sm-labs01.mozilla.org:81 that has been modified to support usernames
- everyone will need to create a new account and this will be streamlined within the startup function, which will now kick off on first run (we'll check in the updated setup wizard shortly)
- this checkin also cleans up a number of strings
2008-06-06 14:18:50 -07:00
Myk Melez
3fd6e2ee70 bug 437523: fix NS_ERROR_FAILURE on nsIJSON.decode in JsonFilter_afterGET 2008-06-05 16:25:55 -07:00
Dan Mills
a2659cdec7 merge upstream changes 2008-06-05 23:11:20 +09:00
Dan Mills
510669d414 create objects for the various server resources (these will later abstract away the actual resources); fix a bug where we were reversing the order of resource filters on every GET request 2008-06-05 16:17:32 +09:00
Dietrich Ayala
58d219c0e7 imported patch xmpp-transport-fault-tolerance-and-test 2008-06-04 18:34:37 -07:00
Dietrich Ayala
db02ef8937 xmpp-stream-error-handling 2008-06-04 17:36:37 -07:00
Dietrich Ayala
8ec3277ff2 [mq]: xmpp-reconnect 2008-06-04 17:00:02 -07:00
Dietrich Ayala
49101addf2 [mq]: xmpp-disconnect 2008-06-04 14:02:47 -07:00
Myk Melez
4041662e5a bug 436696: make sure we pass a valid URI to nsITaggingService::getTagsForURI when the bookmark record doesn't include a URI so the method doesn't throw and hork bookmarks sync 2008-06-04 13:40:53 -07:00
Dietrich Ayala
7b5ca70bb5 [mq]: xmpp-cleanup 2008-06-04 12:14:28 -07:00
Atul Varma
f4000cc8bc In passwords.js, turned _hashLoginInfo() into a module-level function. 2008-06-03 16:56:58 -07:00
Atul Varma
53a37dc1fd Minor js2-mode warning fixes. 2008-06-03 15:14:27 -07:00
Atul Varma
e9e278d370 Removed unused code from cookies.js, fixed a few js2-mode warnings. 2008-06-03 14:49:22 -07:00
Atul Varma
26b0341c5c Moved all tab-syncing code to modules/engines/tabsjs. 2008-06-03 14:45:53 -07:00
Atul Varma
5608238392 Moved all form-syncing code into modules/engines/forms.js. 2008-06-03 14:20:51 -07:00
Atul Varma
8ea237d262 Moved all password-syncing code into modules/engines/passwords.js. 2008-06-03 14:08:53 -07:00
Atul Varma
b20c630abe Moved all history-related functionality into modules/engines/history.js. 2008-06-03 13:56:16 -07:00
Atul Varma
0e8b9eb9af Re-removed cookie-related changes that were accidentally re-added by c1a58b24679c and/or 5a49daf87c94.
Also moved all bookmark syncing logic into modules/engines/bookmarks.js.
2008-06-03 12:38:48 -07:00
Myk Melez
6b9c06e8ed remove unused _json property from TabSyncCore 2008-06-03 11:50:08 -07:00
Myk Melez
07924b2c43 merge 2008-06-03 11:43:07 -07:00
Myk Melez
92b3748833 bug 434817: sync tabs 2008-06-03 11:32:59 -07:00
Atul Varma
7a7a041ace Moved all code related to the syncing of cookies--e.g. CookieStore, CookieTracker, CookieEngine, CookieSyncCore--into their own file at modules/engines/cookies.js. I'll be doing the same to the other engines shortly.
This helps with code organization--all the logic for dealing with a particular data type is now in one place--and should also make it easier to write unit/regression tests.
2008-06-03 11:11:44 -07:00
Myk Melez
826fa1d7f3 minor typo fixes 2008-06-02 15:24:52 -07:00
Dan Mills
6444cadd99 log stack traces from sync exceptions 2008-06-02 13:02:04 +09:00
Dan Mills
ab858fed15 change remote store to keep track of identity names/aliases and fetch the objects from the id manager 2008-06-02 11:10:11 +09:00
Dan Mills
7517154894 move json and crypto into remote resource 'filters', so the engine doesn't have to explicitly encode/decode anything. note--known regression: filters will not use the encryption algorithm in the status file 2008-05-30 20:43:55 -07:00
Dan Mills
e56792c1f6 format exception correctly when an engine throws during sync 2008-05-30 17:40:08 -07:00
Dan Mills
37dd2c0856 make some async generator errors clearer 2008-05-30 17:38:27 -07:00
Atul Varma
4dacc7ee50 Added a trivial appender to faultTolerance.js. 2008-05-30 16:32:06 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
25d2cb8e20 Merged changes 2008-05-30 11:11:02 -07:00
Atul Varma
257f9281de Refactored logging system so that clients don't need to call factory functions to create specific instances of formatters and appenders. 2008-05-29 18:15:50 -07:00
Atul Varma
18c29c94bb Added a testing suite for log4moz, along w/ a few refactorings necessary to perform the tests. 2008-05-29 17:56:52 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
2b44909578 Merged 2008-05-29 11:18:16 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
f27f36243a Moved the Share Bookmarks item out of the Weave popup menu into the Bookmarks menu, folder submenu. 2008-05-29 11:17:54 -07:00
Dan Mills
5476cb0994 Add and start using an object to represent a remote resource (file), and a server object to hold them. Resources will attempt to retry network operations if they fail. 2008-05-28 20:11:39 -07:00
Atul Varma
b40f447c6d Added a trivial fault tolerance JS module with a trivial test suite. 2008-05-28 11:25:28 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
60dbf91bf5 Created a cookie tracker in trackers.js, and a test for it in tests/unit/test_cookie_store.js. 2008-05-27 09:44:26 -07:00
Dan Mills
f7d85070fe bump version constant 2008-05-24 18:56:42 -07:00
Dan Mills
9316037c2c remove some debugging output, fix some remaining array detection code 2008-05-24 17:30:22 -07:00
Dan Mills
38997acef8 continue sync of other engines even after one of them throws an exception; use constructor name instead of instanceof to check for array object in modules 2008-05-23 23:58:53 -07:00
Dan Mills
b91391acd5 don't attempt to get a symkey if encryption is set to 'none' 2008-05-23 19:57:38 -07:00
Dan Mills
f84508aeb7 regenerate the engine id when the engine's pbe id changes 2008-05-23 19:47:25 -07:00
Dan Mills
5d11c540ba branch merge 2008-05-23 17:58:08 -07:00
Dan Mills
1e832d7175 whitespace police 2008-05-23 17:50:54 -07:00
Dan Mills
e9df121cfb don't require same index for folder 'likeness' 2008-05-23 17:50:24 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
5fa21e0f59 Added unit test file for CookieStore. It has a test to make sure that only persistent cookies are wrapped, not session cookies. 2008-05-23 17:49:58 -07:00
Atul Varma
19c389565a Fixed bug 427113: https://bugzilla.mozilla.org/show_bug.cgi?id=427113
I should note that I think that there's a more idiomatic way of doing what I did, but I don't yet fully understand how Weave does things asynchronously.  As such, this commit can probably be refactored to be more in the style of the surrounding code.
2008-05-23 12:22:08 -07:00
Atul Varma
6b81299bdb Fixed bug 435103 (https://bugzilla.mozilla.org/show_bug.cgi?id=435103) 2008-05-23 12:08:03 -07:00
Atul Varma
dcd1221ca9 Routine merge of double branches. 2008-05-23 11:06:45 -07:00
Atul Varma
2802dad13d Fixed a variety of style issues and minor warnings raised by js2-mode. 2008-05-23 11:05:42 -07:00
Anant Narayanan
bcd73659a0 Correct more syntax errors (super) in trackers.js 2008-05-23 11:01:32 -07:00
Anant Narayanan
33f18499e5 Correct syntax error in trackers.js 2008-05-23 10:28:43 -07:00
Anant Narayanan
1fbd5a324f Fix indentation 2008-05-23 09:59:35 -07:00
Anant Narayanan
ad7543aee8 Add tracking support to FormsEngine. Bug #435319, r=thunder 2008-05-23 09:29:26 -07:00
Anant Narayanan
5c0774bdea Tracking support for HistoryEngine. Bug #435321, r=thunder 2008-05-22 18:37:24 -07:00
Anant Narayanan
ac3513379f Correct typo in BookmarksTracker 2008-05-22 18:06:47 -07:00
Anant Narayanan
1c421141bc Add support for engine 'scores'. Bug #434812, r=thunder 2008-05-22 15:58:29 -07:00
Anant Narayanan
af655d694e Sync form data: bug #434818, r=thunder 2008-05-22 15:36:44 -07:00
Dietrich Ayala
12f3dcc427 Bug 419121 - Weave chokes on microsummaries (r=thunder) 2008-05-22 11:41:05 -07:00
Justin Dolske
08b62ce1ba Bug 433762 – Sync stored passwords. r=thunder 2008-05-21 18:09:19 -07:00
Justin Dolske
1d7de9c30b Cleanup some trivial nits with cookie (whitespace and function name). 2008-05-21 17:53:35 -07:00
Anant Narayanan
dcc4181827 Allow login & sync when encryption is off 2008-05-21 16:28:23 -07:00
Anant Narayanan
071c1cffe8 Typo in log message 2008-05-21 11:16:39 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
7dc49c82ec Added TODO that expired cookies should be thrown out, in the unlikely event that we get one from a createCommand or editCommand. 2008-05-20 18:24:28 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
cbc91827ec Made cookie-sync sync only persistent cookies, drop single-session cookies. (Needs testing.) 2008-05-20 18:14:18 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
43ab447e8a Created some documentation of how to add synchronization functionality for a new user data type to Weave. Created a new directory called docs to put this into. 2008-05-19 19:40:45 -07:00
Dan Mills
9c8f71b319 DAV: separate the root url of the DAV repository from the default prefix for all operations (i.e., the user's subdirectory) 2008-05-15 18:08:13 -07:00
Dan Mills
1c1fd8fcce merge with jono's changes 2008-05-12 10:14:15 -07:00
Dan Mills
036c817866 sync bookmark descriptions 2008-05-12 10:11:07 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
f42a4eb7c6 Created a readme for using the XMPP client module. 2008-05-08 18:50:12 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
418cfb5565 renamed testSynchronizer.js to just synchronizer.js, because otherwise the test framework tries to run it as a test itself. 2008-05-06 12:04:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8f6585ff3a Oops, I miscapitalized XmppClient in the export statement -- fixed. 2008-04-30 17:08:39 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
6f9114d384 Made xmppClient, transportLayer, and authenticationLayer into proper modules using Components.Utils. Also renamed the JabberClient class to XMPPClient, which is more accurate (as it implements XMPP which is a newer protocol than Jabber.) 2008-04-30 16:55:34 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
9b50fee839 Gave sasl.js a more descriptive name -- authentication is what it does.
--HG--
rename : services/sync/modules/xmpp/sasl.js => services/sync/modules/xmpp/authenticationLayer.js
2008-04-30 16:29:03 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
96d43325c9 Merged my changes with the main repository. 2008-04-30 16:27:52 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
a7ee9d6de3 First commit of my XMPP client, as demonstrated at the meeting today, to weave/modules. This does not include the test-synchronization stuff. xmppClient.js is the main client class; transportLayer.js and sasl.js (which does authentication) are the helper classes. 2008-04-30 16:27:32 -07:00
Dan Mills
1b281e0bfe service: remove accidental 'resetServer' call in sync (\!); dav: lock a file called 'lock', instead of the entire collection (workaround for bug 421610) 2008-04-16 14:46:57 -07:00
Dan Mills
9a24767ab7 engines now get the pbe identity directly from the identity manager; engines now know their 'enabled' status (pref); main service syncs *all* registered (enabled) engines 2008-04-15 17:21:34 -07:00
Dan Mills
1fa3e135bc add engine registration service; use global id service in service.js 2008-04-14 18:53:35 -07:00
Dan Mills
017524a4d0 Various improvements:
* async generators: much better stack traces
* dav: use global identity system rather than login/logout to manage
  usernames and passwords.
* dav: there is a checkLogin() instead of login() which can be used to
  verify auth at any time.
* dav: make it so that we can (only internally atm) hold multiple
  locks for different URLs.
* identity: add an identity manager singleton service to keep
  identities globally, referenced by a name, with aliasing support (so
  e.g., dav can ask for the 'dav' identity, while something else can
  alias 'dav' to another identity).
* service: keep track of logged in status here, rather than in the dav
  service.  Use the global id manager.
2008-04-10 21:38:15 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
ebed002936 Implemented cookieStore.editCommand(). 2008-04-07 11:53:55 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
64ad0b98fa Semicolon was missing in cookieStore.wrap() 2008-04-04 12:09:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
162b86b36f Prettied up my code by using block comments and making my indents 2 spaces. 2008-04-04 12:08:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8313850210 Merged changes from Dan 2008-04-04 10:50:21 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
304fa26587 Removed comment from load-weave.js that I put in while debugging and committed by accident. 2008-04-04 10:49:41 -07:00
Dan Mills
3008a07ee0 rethrow exception when applyCommands fails; merge changes from jono 2008-04-03 17:18:38 -07:00
Dan Mills
641c1bbc04 rethrow exception when applyCommands fails 2008-04-03 17:16:22 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
8507db265b Discovered that trying to use duck-typing in passing an object into cookieExists() will hard-crash Firefox, and figured out why; added comment to syncCores.js explaining this. 2008-04-03 14:30:34 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
dc5e6d89c9 Fixed bugs in cookieSyncCore.itemExists and cookieStore.addCommand. The problem in addCommand was just a missing argument, but in itemExists I had to change the implementation to use cookieManager.enumerator rather than cookieManager.findMatchingCookie -- the latter function apparently does not exist in the nsICookieManager2 interface despite what MDC says about it. 2008-04-03 14:26:06 -07:00
Dan Mills
ecd1ab657d don't fail on invalid server deltas which don't apply to the local snapshot; wipe the local snapshot instead 2008-04-02 00:00:24 -07:00
Dan Mills
22b777ce83 bump version 2008-04-01 23:44:39 -07:00
Dan Mills
c59e0aba36 make login more robust, specially work around first-login oddities with services.m.c 2008-04-01 23:43:14 -07:00
jono@jono-gibbon-laptop
a9e9bdb38e Updated the comment in CookieStore.editCommand. 2008-04-01 19:16:27 -07:00
jono@jono-gibbon-laptop
dab32afc55 Removed some lines that were only in there for debugging purposes. 2008-04-01 19:12:03 -07:00
jono@jono-gibbon-laptop
6c13165436 Fixed some minor errors in cookieStore / cookieSyncCore (still getting used to the getter idiom in javascript -- had too many underscores). Syncing cookies now works in as much as it can upload all cookies to the server without raising any exceptions; now to see if it can download and merge cookies on the other side... 2008-04-01 17:51:10 -07:00
jono@jono-gibbon-laptop
bc2b54e0cd Fixed a couple of missing symbol exports that were stopping CookieEngine from being able to be instantiated. 2008-04-01 17:32:14 -07:00
jono@jono-gibbon-laptop
5d62b467ca Fixed a couple of syntax errors that were preventing weave from starting 2008-04-01 16:36:08 -07:00
jono@jono-gibbon-laptop
b70fbb03c2 Merged changes and resolved conflicts between my cookie stuff and r282. 2008-04-01 14:46:29 -07:00
Dan Mills
95d8146ce0 bump version 2008-03-31 17:46:29 -07:00
Dan Mills
94392ccf5d fix tag sync 2008-03-31 17:07:40 -07:00
Dan Mills
eb446df148 [mostly] beat login dialog into submission; use DAV singleton instead of making a new DAVCollection in service.js; split up checks from login into their own functions, call them on sync(); check we are logged in before syncing 2008-03-31 07:20:09 -07:00
Dan Mills
c5ddd41680 bump storage format version to cause a server wipe 2008-03-30 08:52:49 -07:00
Dan Mills
9b6f850e27 bump version 2008-03-30 08:42:35 -07:00
Dan Mills
6726d4d1c1 use the wrapper notifier for login(), change observers to the slightly different observer topics; allow server url to not have a trailing slash (add one automatically); dial down dav.js verbosity; add serverWipe service method; change 'reset server data' button in prefs pane to do serverWipe instead of resetServer; allow for wrappers to have extra args both saved in the closure (at wrap creation time) as well as passed in later (via .async()) 2008-03-30 08:40:23 -07:00
Dan Mills
bd57ab6275 remove try/catch block in the reconciler; correctly fix parent guids of remove commands during guid changes; only allow guid changes for create commands 2008-03-30 03:36:25 -07:00
Dan Mills
028835fd5e fix the bookmarks likeness comparator (a.data undefined bug) 2008-03-29 00:00:16 -07:00
Dan Mills
86caf96468 ignore 'type' properties in edit commands; fix history sync 2008-03-28 22:55:23 -07:00
Dan Mills
5ec2b83320 fix 'clear logs' on windows 2008-03-28 19:36:11 -07:00
Dan Mills
012d0d35d3 bump version 2008-03-28 03:27:05 -07:00
Dan Mills
26713b0184 add status notification to sharing dialog; fix async generators in the case where an async method is missing a yield (better error, continue execution in parent); add guts of demo sharing code to engine & store (for bookmarks, with some spillage) 2008-03-28 03:25:51 -07:00
Dan Mills
38ed71b0a2 status label now has service status instead of username; service [un]lock observer notifications are gone; don't error when async methods don't call done() - consider them methods with no return value; don't require passing null into login() to cause the identity to look up the password in the pw mgr; make some wrapper 'method generators' to make lock handling and observer notification simpler 2008-03-27 19:12:53 -07:00
Dan Mills
d671b0ce51 remove old '500 error' hack for services.m.c during mkcol; fix applyCommands to do async right & make a listener correctly 2008-03-26 23:51:01 -07:00
Dan Mills
255bfe18ef make XHRs non-blocking again; change sharing dialog so sharing is done without closing the dialog (still lacks any feedback though) 2008-03-26 23:22:35 -07:00
Dan Mills
595423713c fix typo 2008-03-26 23:12:58 -07:00
Dan Mills
332279d554 make applyCommands asynchronous 2008-03-26 23:11:15 -07:00
Dan Mills
a7291a69bd improve async generator logging; don't call done() on StopIteration when we already have a timer set (it means the generator just 'bottomed out' after calling done()); make XHRs be synchronous (blocking) - temporarily; fix up sharing code (adding to the keyring) 2008-03-26 00:59:34 -07:00
Dan Mills
4bbd3af126 add sharing ui+backend code (not working yet); make engines less chatty when applying commands 2008-03-25 23:01:34 -07:00
Dan Mills
89a59249b4 make service.js the main entry point from chrome/content; make the service be lazy-loaded; make crypto be lazy-loaded 2008-03-25 15:14:00 -07:00
Dan Mills
49d0c55031 lazy-load service 2008-03-25 13:55:34 -07:00
Dan Mills
7b07d8bc8e work with all exception objects, whether we can modify them or not 2008-03-24 19:08:43 -07:00
Dan Mills
d43f7f0db3 bump version 2008-03-24 16:05:02 -07:00
Dan Mills
07453392ca decrypt private rsa keys before decrypting data with it (rather than doing it in one step). fix for windows openssl.exe 2008-03-24 16:04:29 -07:00
Dan Mills
ea7fa06dd8 bump version; bump storage format version 2008-03-21 16:07:44 -07:00
Dan Mills
254b85afef fix resetClient's locking. change bookmarks wrap format to have hardcoded guids for the 3 roots (menu, toolbar, unfiled) rather than random ones. 2008-03-21 15:56:41 -07:00
Dan Mills
6af85fdce1 bump version 2008-03-20 14:59:59 -07:00
Dan Mills
c55b325521 bookmarks syncCore: remove actions never qualify for 'likeness' 2008-03-20 14:59:20 -07:00
Dan Mills
1908175a9c split up/simplify login functions; add a global (server-wide) storage version; wipe server for storage version upgrades 2008-03-19 18:42:12 -07:00
Dan Mills
8613bae127 bump version 2008-03-19 17:31:45 -07:00
Dan Mills
d55f8969ad bookmarks sync core: always include type information when generating commands. also, allow for properties to not be set when comparing commands for likeness. 2008-03-19 17:31:00 -07:00
Dan Mills
384d06b7c6 Various improvements:
* Logging improvements / default log levels tweaked.  Less chatty now.
  Ability to tweak log levels of individual loggers via prefs.
* Various crypto module fixes, specially for RSA.
* 'service' lock removed, reuses server lock now.  dav module supports
  temporarily blocking locks to simulate the 'service' lock (login()
  needs this, since dav is not configured at that time).
* PKI support: data encryption uses randomly-generated symmetric keys,
  which are then encrypted with RSA public keys and stored on the
  server.
2008-03-19 15:17:04 -07:00
Dan Mills
7077b3f6d5 bump version 2008-03-12 23:07:04 -07:00
Dan Mills
4fd10f52ed workaround for services.m.c 500 error on some GET requests 2008-03-12 23:06:28 -07:00
jono@jono-gibbon-laptop
6ee09339fc Merged my changes with the changes to async.js -- no conflicts. 2008-03-11 14:59:06 -05:00
thunder@h-132.office.mozilla.org
a31ac97660 add missing async.js module 2008-03-11 11:47:54 -07:00
jono@jono-gibbon-laptop
f87939266d My changes to weave to enable cookie synchronization. So far untested and still missing a thing or two. 2008-03-11 12:08:38 -05:00
Dan Mills
0b431a8016 fix full (first) upload brokenness 2008-03-07 04:49:56 -08:00
Dan Mills
056dc3d2eb add a dav method for getting a list of server files/directories; delete all server data when private key isn't found (this will cause everyone's server data to get wiped, since no one has a key yet); fix a bug in checkStatus with specific status codes (as opposed to ranges) 2008-03-07 04:20:55 -08:00
Dan Mills
67b2693549 version bump 2008-03-07 01:57:18 -08:00
Dan Mills
99333d3c98 Asynchronous generator helpers rework + PKI work
* Async helpers are in a module of their own now
* Async routines have simpler semantics now.  onComplete handlers are taken care of by the helpers.  Exceptions are bubbled up across nested asynchronous generators
* Stack traces are automatically logged for unhandled exceptions
* Async generators are now allowed to 'bottom out' (StopIteration is ignored) - this is configurable.
* RSA key generation fixes
* On login we now create an RSA keypair, encrypt the private one with PBE, and upload them to the server
* Log files are now limited to 2MB (down from 5)
2008-03-07 01:56:36 -08:00
Dan Mills
ad5f58d76e don't sync bookmarks/history unless they have been enabled 2008-03-05 18:36:58 -08:00
Dan Mills
2026c141ba ignore broken local snapshots if they can't be parsed; trigger an initial sync instead 2008-03-05 17:11:08 -08:00
Dan Mills
019a0c8e6c switch to nsIJSON for JSON parsing and output. add a deepCopy function instead of using eval(uneval()). make *sure* to read and write UTF-8 to files. bump version 2008-03-05 00:00:56 -08:00
Dan Mills
9b83d920fa fix openssl args mangling 2008-02-19 21:01:11 -08:00
Dan Mills
e4d6f08edb version bump 2008-02-19 20:53:45 -08:00