1244 Commits

Author SHA1 Message Date
David Glasser
ba76b0fd6d Follow-up to 426a72fe: make sure loggingIn goes away in the case of a half-complete login method. 2012-11-19 21:08:41 -08:00
David Glasser
426a72fe24 Don't display logging-in animation in onReconnect. 2012-11-19 20:33:39 -08:00
Avital Oliver
7cc88dc75e accounts-ui: show messages in all dropdowns 2012-11-19 20:29:02 -08:00
Avital Oliver
59bab69fcc accounts-ui: don't display message twice 2012-11-19 19:34:42 -08:00
David Glasser
738e8f43fa Meteor.loggingIn now true during the beginPasswordExchange part of
Meteor.loginWithPassword.
2012-11-19 16:42:17 -08:00
Nick Martin
3b97c9199f Use absoluteUrl in tests so that tests pass when you visit them via something other than 'localhost' (e.g., when testing IE using an VM) 2012-11-19 14:49:45 -08:00
Nick Martin
46c14a7405 Workaround new underscore failure in IE8. 2012-11-19 14:18:04 -08:00
David Glasser
c1c1fd9b8f Fix bug where half-completed wait methods could block future method execution. 2012-11-16 21:07:51 -08:00
Avital Oliver
646b3576cd accounts-ui fixes related to the introduction of {{loggingIn}}
- Correctly position certain elements
- Reduce flicker/things moving around in various cases
- Force dropdown to open in case there is a message to display
2012-11-16 17:25:52 -08:00
David Glasser
e93e35ce08 Improve test isolation in livedata_tests. 2012-11-16 16:57:16 -08:00
Nick Martin
d1ce91d48e Update sockjs to 0.3.4. This removes the meteor patch from #339, but preserves the patch to do http->https on IE. 2012-11-15 20:44:57 -08:00
Nick Martin
dc62e2cef0 Bump jquery to 1.8.2. 2012-11-15 20:44:56 -08:00
Nick Martin
2a68982e87 Make jquery-history package use the json package, not ship its own copy of json2.js 2012-11-15 20:44:56 -08:00
Nick Martin
d2b5daef2e Bump bootstrap to 2.2.1 2012-11-15 20:44:56 -08:00
Nick Martin
34b7bdbbac Bump underscore version. 2012-11-15 20:44:56 -08:00
Nick Martin
eee0f744d4 Add default safe mode option to stop mongo driver from printing a warning. 2012-11-15 20:44:54 -08:00
David Glasser
48a74d70a8 Change "wait" methods to do a full quiesce: ie, they do not stream data.
Rationale: "wait" methods are used for login/logout, which tend to make drastic
changes that should take effect atomically rather than streamy. (Without this,
logging out with accounts-ui saw the username disappear before the buttons
switched from "sign out" to "sign in", eg in single-button mode. Now it goes
directly from "signed in with username visible" to "signed out".)
2012-11-15 15:45:47 -08:00
David Glasser
183653e381 Make multiple observes of the same Mongo cursor share their polling cycles.
There is no longer any explicit time-based throttling of Mongo poll calls,
though we do prevent multiple instances of polling to be scheduled at once. If
this appears to be a problem, we can reintroduce throttling.

Note: this can lead to a hang if you start observing a cursor during a callback
from an identical cursor's observation. This doesn't seem to be a very realistic
use case though.
2012-11-15 12:47:40 -08:00
David Glasser
41b0c28807 Refactor mongo-livedata cursor objects.
Separate the "description" of the cursor from the actual wrapped Mongo
cursor.

Collection.find() no longer runs a Mongo query: you have to actually call a
function like fetch, count, or observe on the cursor to run the
query. (Specifically, this lets us skip a useless query when a publish function
returns the result of a find().) This implies that errors that used to be
reported at find() time are now reported later.

Also, allow objects other than Mongo cursors returned from publish functions to
define their own _publishCursor functions (this is not documented or officially
supported). The _publishCursor code is moved from the livedata package to
mongo-livedata.
2012-11-15 12:33:49 -08:00
David Glasser
c7710ccd3e New class Meteor._SynchronousQueue, which runs tasks serially.
Will be used for Meteor._Mongo._LiveResultsSet de-duping.
2012-11-15 12:33:49 -08:00
David Glasser
11fe37a007 Wrap mongo_driver.js in anonymous function call.
This has the side effect of forcing several other files to pull in the Fiber
symbol explicitly.
2012-11-14 18:15:25 -08:00
David Glasser
f8c54c4046 Overhaul quiescence, method callback timing, and login methods on the client.
- Data streamed from the server is quiesced on a per-object basis, not a global
  basis. We track which documents a method stubs modifies, and create individual
  snapshots ("server documents") of those documents rather than whole-Collection
  snapshots. Data writes from the server to documents not modified by stubs are
  applied immediately to the local cache; other writes are applied to the
  "server document" snapshots. Server documents are flushed to the local cache
  when all method stubs that wrote to the document have sent their "data write"
  message.  (We still do "full database" quiescence after a reconnect.)

- Instead of calling method callbacks as soon as the result is received, we wait
  until all data that precedes their "data done" message is flushed to the local
  cache. This way, method callbacks can see all of their results locally. (This
  applies to Collection mutator callbacks as well.) If this delay is
  unacceptable, you can also specify the onResultReceived option to
  Meteor.apply; this callback is given the method result as soon as it comes in,
  and there's no guarantee that the local cache is up to date.
  (This is a client-only change: server-side callbacks do not block on the
  write fence.)

- Methods invoked with the "wait" option to Meteor.apply now wait until all
  preceding methods are fully finished to be *sent*, not just to call their
  callbacks. ie, previous calls block the "wait" method in the same way that
  "wait" methods block subsequent calls.

- Remove Meteor.userLoaded and {{currentUserLoaded}}.
  Meteor.userId() is now set only at the point where Meteor.user() is fully
      loaded.
  Current user data is published via an unnamed subscription, not via
      "meteor.currentUser".
  Replace them with Meteor.loggingIn() and {{loggingIn}}, which become true
      as soon as the login method is sent (instead of only once it succeeds).
  In accounts-ui, move the spinny into the dropdown, because it now shows up
      before error messages would.

- Previously, if we received the "result" message from a method but no "data"
  message, and then disconnected and reconnected, quiescence would be
  permanently blocked. Now, not only do we allow the app to continue working,
  but we even guarantee that the method's callback will be called at the
  "reconnect quiescence" point.

- Remove reset function from the Store API (the interface between
      _LivedataConnection and Collection), and add a boolean "reset" argument to
      beginUpdate instead.
  Add saveOriginals/retrieveOriginals functions to the Store API (pass-through
      to minimongo implementation).
  Allow "replace" messages to be passed to the Store API's update function
      (in addition to set/unset).
  Allow Store API implementations (eg tinytest_client) to not specify all
      functions.

- Server-side tinytest results now stream into the result page instead of
  appearing all at once at the end.

- Rename fields and methods of Meteor._LivedataConnection as camelCase, and
  prepend all internal fields with _.

- Different Meteor._LivedataConnection objects now have separate
  _userIdListeners _ContextSets.

- Remove snapshot/restore functionality from Minimongo collections. (Individual
  queries still have result snapshots.) The "server documents" in
  Meteor._LivedataConnection serve the equivalent purpose.

- Meteor.loginWithToken's callback is now a "call with error on error, call
  with no args on success" callback like the other login callbacks.

- The test-only Meteor._LivedataConnection.onQuiesce function is removed.
  Every single use of it is now supported by normal method callbacks.
2012-11-14 18:10:08 -08:00
David Glasser
ac4b0d687b Add saveOriginal/retrieveOriginal methods to LocalCollection.
This will eventually be used to replace snapshot/restore. snapshot/restore are
used to implement full-database quiescence; saveOriginal/retrieveOriginal will
be used to implement per-object quiescence.

Also, throw on duplicate-ID insert.
2012-11-14 18:10:08 -08:00
Avital Oliver
3e2de505b0 Don't drop method calls on the floor shortly after connectivity loss. Fixes #339 2012-11-14 16:29:01 -08:00
Avital Oliver
54b1411b72 Improve docs around internal patches to sockjs
Refer to the GitHub issue discussing a bug.
2012-11-14 14:31:02 -08:00
David Glasser
e5769d7a2a Revert "Make Meteor._WriteFence available on the client as well as the server. Keep"
This reverts commit 0092a560f2.

The goal for _WriteFence is that it be specific to the concept of declaring when
writes are done (and one day may be a networked message bus), not that it be a
generic "call this method after these methods" helper.
2012-11-13 18:40:18 -08:00
David Glasser
4f952daba6 Move Future.ret alias to fiber_helpers. 2012-11-09 17:28:47 -08:00
David Glasser
a87c6580d5 Don't call "stop" on already-stopped observe handles, when unsubbing after a
setUserId.
2012-11-09 16:23:18 -08:00
David Glasser
ea4d04c58b New helper Meteor._noYieldsAllowed: ensures that a section of code does not yield. 2012-11-09 16:22:17 -08:00
Avital Oliver
ead2a14945 Change error message: No such partial -> No such template 2012-11-09 11:17:59 -08:00
David Glasser
0092a560f2 Make Meteor._WriteFence available on the client as well as the server. Keep
Meteor._CurrentWriteFence on server only.
2012-11-08 17:26:27 -08:00
Dan Dascalescu
e8f1510aed Minor grammar fix in livedata_connection.js
While looking for a potential solution to [#132](/meteor/meteor/issues/139#issuecomment-10090472)
2012-11-05 20:58:25 -08:00
David Glasser
a5cc93ee55 Remove the 'sass' package, as warned in 0.5.0.
Meteor's sass package wraps the "sass" NPM module, which implements a version of
the Sass language much older than the .sass described at sass-lang.com (and
doesn't implement the current recommended .scss language at all). It also has
poor error handling, so it mostly just ends up confusing users.

The module is unmaintained, and its author now uses stylus/nib (which Meteor
supports: see the stylus package).

If many users want Sass support, we could add this back in wrapping the
"node-sass" package instead (which supports a more recent version of the Sass
language), but for now, just remove it. Meteor still supports Stylus and Less
out of the box.

Fixes #143.
2012-11-05 15:24:08 -08:00
David Glasser
bad0726a99 Rename Meteor.setPassword to Accounts.setPassword, matching docs.
We meant to do this before releasing 0.5.0 (thus the docs) but mistakenly did
not.

Fixes #454.
2012-11-05 10:51:41 -08:00
David Glasser
f58cbc620a jquery-history: check in unminified version. Fixes #452.
We minify at bundle time, so no reason to minify in the repo.

Copied from balupton/history.js@e84ad00. I confirmed that the version we had
checked in was equal to scripts/bundled/html4+html5/jquery.history.js in that
repository.
2012-11-05 10:40:51 -08:00
Tom Coleman
c27941589c Fixed a problem with deep object selectors with differing keys in minimongo.
Select from minimongo would match objects who different in deep keys (not
values). It seems like the object matching of selector.js was intended to work
this way (the name `b_keys` implies that it should be the keys of `b` after
all), but was mis-implemented.

Fixes #455 - a subtle bug with almost-overlapping subscriptions

(glasser added another test case and cleaned up test whitespace.)
2012-11-05 10:09:17 -08:00
David Glasser
aaf5c633c1 No need to include comment in DOM for each failure. 2012-11-03 20:10:22 -07:00
Avital Oliver
62b5f1c7ba Small bugfix to new formatting of test errors 2012-11-03 10:25:52 -07:00
Avital Oliver
d4558fd8a0 Merge branch 'improve-test-error-readability' of git://github.com/possibilities/meteor into tests 2012-11-02 19:53:38 -07:00
Avital Oliver
b1eb334d41 accounts-ui improvements
- Better behavior when in-line. Text around {{loginButtons}} does not move up and down when logging in and out
- In various cases, text underneath {{loginButtons}} no longer moves up and down when logging in
- Refactored the way we support right-aligned login dropdowns to not use a container div
- Use inline-block instead of float for the image inside the login buttons
- Generally use inline-blocks more correctly (rather than blocks inside inline-blocks)
- Some other small refactoring
2012-11-02 12:20:22 -07:00
David Glasser
ab8c03e6f7 Add an internal-only (for now) Cursor._observeUnordered API.
Unordered observations have no moved callback and don't pass indices to the
other callbacks. This is used for the automatic cursor publication (because DDP
collections are not ordered) and for Cursor.count(). Internally, the results of
unordered observations are stored as objects instead of an array. This change
has no publicly observable changes, but should increase performance, especially
server-side (since the _diffQuery that drives DDP subscription updates no longer
needs the full complexity of the ordered move detector).

Also, minor optimization to LocalCollection.Cursor._getRawObjects where the
selector is a single ID that is not in the collection (now O(1) instead of
O(n)).
2012-11-02 12:10:47 -07:00
Avital Oliver
ae68aa22e6 accounts-ui: Hide "Create account" link when signups are forbidden 2012-11-01 18:15:31 -07:00
Avital Oliver
ac001dbad0 accounts-ui: comment fix 2012-11-01 13:16:50 -07:00
Dan Dascalescu
7350a5396f Update Google account configuration instructions
Here's a screenshot from a Google Apps account: http://i.imgur.com/h6emA.png
2012-11-01 09:46:38 -07:00
Avital Oliver
cf1e7fa669 Rename packages/accounts-password/passwords_* to password_* 2012-10-31 12:07:06 -07:00
Tom Wijsman
8f83b2c32e Made sure all file system related statements use proper path.join and path.sep to support other platforms. 2012-10-30 15:53:49 -07:00
Nick Martin
cb0d7238a1 Convert to use regexps for user agents, so we can match multiple Facebook agents. 2012-10-29 19:14:22 -07:00
ayalgelles
2b72391ccf using a list of agents to serve 2012-10-29 19:14:22 -07:00
ayalgelles
40010607af serve facebookexternalhit user agent with spiderable 2012-10-29 19:14:22 -07:00
David Glasser
1c9a5f9f6f Improve test isolation in email_tests. 2012-10-29 12:43:44 -07:00