Commit Graph

351 Commits

Author SHA1 Message Date
Dan Mills
589f3222eb 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
9812ba557e 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
Atul Varma
4864f07ae2 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
7d98a5dbeb 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
Atul Varma
28a0971380 Merged changes. 2008-06-11 18:03:11 -07:00
Atul Varma
78c2bba04d Added test_async_missing_yield. It's very messy right now and duplicates code from other tests, but I've got some ideas about how to write better tests for async ops that I'll commit soon. 2008-06-11 18:02:46 -07:00
Maria Emerson
7da4259fee bug 438033: implement a better first-run wizard process; r=myk 2008-06-11 17:56:02 -07:00
Myk Melez
f9ef596828 Automated merge with ssh://hg.mozilla.org/labs/weave/ 2008-06-11 17:45:54 -07:00
Myk Melez
0a15090c8c 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
Atul Varma
d32ba01952 Modified test_async_exceptions to use a fake nsiTimer. 2008-06-11 17:10:39 -07:00
Atul Varma
561d94aa66 Added a unit test for async exceptions. 2008-06-11 16:38:22 -07:00
Myk Melez
8182b10abf 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
633afe0864 clarify wording in scheduled sync threshold debug statements 2008-06-11 14:16:03 -07:00
Myk Melez
555b8a7be4 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
2b2192aca5 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
Myk Melez
932871d1bd merge 2008-06-11 10:41:57 -07:00
Myk Melez
4a8808e790 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
482d745360 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
5ca3a1eb7f merge upstream changes 2008-06-11 23:31:28 +09:00
Myk Melez
0f8b279e6e 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
de1d1acb26 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
9cb5d2c8cc Make sync service check score before syncing: bug #434816 (r=thunder) 2008-06-10 13:45:37 -07:00
Atul Varma
9c1413e024 Factored out all the logging+async setup code from test_sharing.js into a new global function, makeAsyncTestRunner(), which turns an async.js-style generator into a unit test. 2008-06-09 20:51:23 -07:00
Atul Varma
9cc4da48c1 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
98a85cbd23 Refactorings to test_sharing.js to make it use the async do_test_pending()/do_test_finished() calls. 2008-06-09 19:18:14 -07:00
Atul Varma
2905492e20 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
Atul Varma
6fc267b942 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
813c1abb3f Added a POST method to dav.js. 2008-06-09 17:36:54 -07:00
Atul Varma
53f7206dec Just added a few semicolons that js2-mode warned me about. 2008-06-09 09:45:55 -07:00
Atul Varma
3bb8a88ccf Added more tests to test_async.js and documented them a bit. 2008-06-07 00:34:33 -07:00
Atul Varma
ce74084744 Fixed an inaccuracy in the async.js test suite. 2008-06-07 00:22:57 -07:00
Atul Varma
394167a10a Added a unit test suite for modules/async.js. 2008-06-06 21:40:30 -07:00
chris@h-194.office.mozilla.org
30795b78b9 merging branches 2008-06-06 17:58:02 -07:00
chris@h-194.office.mozilla.org
062c813474 - Adding temporary button to load account creation form for sm-labs01 while work continues on the first run process.
- Minor reorganization of preferences, namely, moving the advanced debugging tools into a sub-dialog and ensure each have a descriptive confirmation prompt.
2008-06-06 17:57:16 -07:00
Atul Varma
29434b62a4 Merged changes. 2008-06-06 17:46:46 -07:00
Atul Varma
49ad148d83 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
473352178e 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
3db8dcb84c 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
a800ba8d31 - turning in the bookmarks sharing UI, although it's still not fully functional. 2008-06-06 14:40:35 -07:00
chris@h-194.office.mozilla.org
d7c750f0f9 - 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
f096ecbbf4 bug 437523: fix NS_ERROR_FAILURE on nsIJSON.decode in JsonFilter_afterGET 2008-06-05 16:25:55 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
12ae1f3d1c Re-disabled test_xmpp_simple.js; it shouldn't be run without a local jabber server (and it wasn't, until I accidentally comitted my local change enabling the test. 2008-06-05 12:18:16 -07:00
Dan Mills
b32b7d3549 merge upstream changes 2008-06-05 23:11:20 +09:00
Dan Mills
c2081e7fb9 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
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
a8012cad1d Merged 2008-06-04 20:30:56 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
e578f11c10 The menu icon of a bookmark folder now changes when that folder is being shared out with others. 2008-06-04 20:30:37 -07:00
Dietrich Ayala
406a97aee2 imported patch xmpp-transport-fault-tolerance-and-test 2008-06-04 18:34:37 -07:00
Dietrich Ayala
ecbfb93933 xmpp-stream-error-handling 2008-06-04 17:36:37 -07:00
Dietrich Ayala
3d3869c8a5 [mq]: xmpp-reconnect 2008-06-04 17:00:02 -07:00
Dietrich Ayala
3e4256b313 [mq]: xmpp-disconnect 2008-06-04 14:02:47 -07:00