Commit Graph

5020 Commits

Author SHA1 Message Date
Emily Stark
9fc73eee9f Update comment to reflect the things a login method must actually do 2013-12-04 22:29:27 -08:00
Emily Stark
a812601ca6 Merge remote-tracking branch 'origin/devel' into sso 2013-12-04 22:08:05 -08:00
Emily Stark
43648de7e5 Use array of args when applying reconnect 2013-12-04 22:05:28 -08:00
Emily Stark
a3abdfe8f9 Get rid of last vestiges of options for makeElectorTries 2013-12-04 21:27:06 -08:00
Emily Stark
3353869727 Replace sessionData._url with Meteor.server._urlForSession 2013-12-04 19:10:03 -08:00
Emily Stark
56ec768f2f Merge remote-tracking branch 'origin/pr-1611' into sso
Conflicts:
	History.md
	packages/livedata/livedata_connection.js
	packages/livedata/livedata_server.js
	packages/livedata/stream_client_nodejs.js
	packages/livedata/stream_server.js
2013-12-04 18:54:13 -08:00
Emily Stark
18704dccaa Note in the docs that BrowserPolicy can only be used in server code 2013-12-04 10:40:49 -08:00
Nick Martin
842b6fec1b History note for session hooks. 2013-12-04 02:25:53 -08:00
Nick Martin
6a308d1c97 Rename this.session to this.connection. 2013-12-04 02:10:47 -08:00
Nick Martin
eb591c4172 Update and tweak docs for new name. 2013-12-04 01:47:50 -08:00
David Glasser
6582a88608 Fix 0.6.6 regression in setting MAIL_URL
Also:
- ensure that AppConfig callbacks are always called at least once
- don't start a new AppConfig Fiber every time you call Email.send

Fixes #1649.
2013-12-03 14:49:38 -08:00
Slava Kim
df95f1e914 Properly handle projections where '_id' is the only rule.
+ Tests. Fixes #1651
2013-12-03 13:39:50 -08:00
Emily Stark
cd6770eb81 Remove ssh tunnel code from meteor tool 2013-12-03 08:56:37 -08:00
Nick Martin
76808dfce2 Remove trailing whitespace. 2013-12-03 03:57:28 -08:00
Nick Martin
1c3877eeb6 Rename establishConnection to be more test-y. Also comment on inappropriate placement. 2013-12-03 03:49:34 -08:00
Nick Martin
c99b0f4475 Move StubStream from test-helpers to livedata. It is only used in livedata tests. 2013-12-03 03:29:29 -08:00
Nick Martin
50870590e2 Make test more robust to other tests leaving things in a bad state. 2013-12-03 03:13:13 -08:00
Nick Martin
a899d2c54d Remove email stubbing code that wasn’t safe for running multiple times on the server. 2013-12-03 02:48:41 -08:00
Nick Martin
09521e9b0c Rework tests that didn’t work when multiple clients run at once. release/pr-1611-3 2013-12-02 23:23:08 -08:00
David Glasser
4ea191e452 Drop uglify dependency from handlebars module
This reduces the npm download done when updating the handlebars package
by 2M.  (Uglify is only used by bin/handlebars, not the handlebars API.)
2013-12-02 19:12:09 -08:00
David Glasser
e11228a3f8 Clean up package dirs containing only ".build"
These directories are often left around when switching from another
branch; git does not delete the gitignored .build directory (but it will
show up annoyingly in 'git status').
2013-12-02 17:50:30 -08:00
David Glasser
cd873c0e47 Drop handlebars from the dev bundle. 2013-12-02 17:15:37 -08:00
David Glasser
8ab66ff255 Stop using handlebars in the bundler.
The dev bundle contains a copy of the handlebars NPM module solely for
creating app.html.  This is separate from the NPM module used by the
handlebars NPM package.

On the shark branch, we no longer use the handlebars NPM module for
Meteor template (it is being replaced by Spacebars), so in preparation
for that, we'll remove this barely-used build-time dependency on
handlebars.

A subsequent commit will remove it from the dev bundle.

Once the Spacebars API has fully settled (eg, it has been merged to
devel), we should get rid of this ad hoc templating and replace it with
Spacebars, either in webapp_server (driven entirely by program.json) or
by using unipackage.load in bundler.
2013-12-02 17:15:37 -08:00
David Glasser
c066b90e1c Add comment referencing #1648 2013-12-02 16:59:50 -08:00
David Glasser
0a4663bafd Upgrade websocket-driver from 0.3.0 to 0.3.1
This fixes a DoS we found:
https://github.com/faye/faye-websocket-node/issues/26
2013-12-02 16:49:09 -08:00
Naomi Seyfer
b1cc446fc8 rename event with a meteor prefix 2013-12-02 16:25:40 -08:00
Naomi Seyfer
bc3b42a941 glasser comments 2013-12-02 15:15:06 -08:00
Naomi Seyfer
d1767da26d Short socket timeout while no pending request. Long timeout with pending req 2013-12-02 14:21:29 -08:00
Andrew Wilcox
7d9f60b07b Remove sessionData.
Add tests to check that account data is cleaned up after a session
closes.

Make `establishConnection` available to account tests.

Remove code duplication between `poll` (now called `simplePoll`) and
the async_multi `pollUntil`.
release/pr-1611-2
2013-11-27 20:01:31 -08:00
Andrew Wilcox
1f3b7cb132 Simplify callers of bindEnvironment by using the new string argument,
when the error callback only needs to print the exception.

Replace unsafe references to `err.stack` with
`err && err.stack || err`.  This avoids throwing a secondary exception
if the original exception in `err` isn't an object (`throw(null)` and
`throw(undefined)` are legal in JavaScript), and also displays the
error object if the stack trace wasn't included.
2013-11-27 20:01:31 -08:00
Andrew Wilcox
c713a664c7 Add a "this.session" entry for methods in the docs.
Pull out the session object into its own documentation section.
2013-11-27 20:01:31 -08:00
Andrew Wilcox
76ae509760 Also make the session available in publish functions. 2013-11-27 20:01:30 -08:00
Andrew Wilcox
bcac2bd11e In the docs, refer to the public object as a "session" instead of a
"session handle".
2013-11-27 20:01:30 -08:00
Andrew Wilcox
f6a5b7734f Fix session handle tests so that multiple copies of the test can run
at the same time.
2013-11-27 20:01:30 -08:00
Andrew Wilcox
5496a4c514 Mention that session id's are globally unique. 2013-11-27 20:01:30 -08:00
Andrew Wilcox
f8a1641517 Check that the connection hasn't been closed already before calling
the onConnection callback.
2013-11-27 20:01:30 -08:00
Andrew Wilcox
33d572a0c2 Documentation update.
Document `Meteor.onConnection` instead of `Meteor.server.onConnection`.

Condense sections about when there is a session reconnect into a
single {{note}}.

Document the `stop` handle returned by `onConnect`.

Document `this.session` in Meteor.methods section.
2013-11-27 20:01:30 -08:00
Andrew Wilcox
0672d20d89 Alias Meteor.server.onConnection to Meteor.onConnection 2013-11-27 20:01:30 -08:00
Andrew Wilcox
17674196c8 Include the session handle in a method invocation instead of just the
session id.

Make _sessionData available in a nested method invocation on the
server.
2013-11-27 20:01:30 -08:00
Andrew Wilcox
1034e5c8a1 Meteor.server.onConnection documentation. 2013-11-27 20:01:30 -08:00
Andrew Wilcox
d3234aa973 Run nodejs stream client callbacks in a fiber.
Poll instead of using Deps.autorun in server test.

When polling the client connection, tests don't have a chance to
disconnect before the stream client automatically reconnects, so add
an option to disable retries for testing.

Callers of `Meteor.bindEnvironment` often have the `onException`
argument print the exception stack trace.  To allow for less code
duplication, let the argument be a string providing the context
(e.g. "connection closed callback"), and then on an exception print
the context and the exception stack trace.
2013-11-27 20:01:30 -08:00
Andrew Wilcox
b2bb2c0dab Space out code for readability. 2013-11-27 20:01:30 -08:00
Andrew Wilcox
f80e7b56d4 Closing a session should be idempotent. 2013-11-27 20:01:29 -08:00
Andrew Wilcox
10ddcdd1e7 Move login token code into the "RECONNECT TOKENS" section. 2013-11-27 20:01:29 -08:00
Andrew Wilcox
42f0eef9da Underscore internal _getLoginToken and _setLoginToken.
`closeSessionsForTokens` doesn't need to clone `sessionsByLoginToken`
because `onClose` callbacks are deferred.

Simplify `closeTokensForUser` by using `_.pluck`.
2013-11-27 20:01:29 -08:00
Andrew Wilcox
02c4ff36df Wrap calling session close callback in Meteor.defer, so that a bunch
of connections can be closed without waiting for the close callbacks
on one connection to return before closing the other connections.

Underscore internal Session field `_closeCallbacks`.

Update comment to explain the cause of the problem requiring the use
of `Meteor.bindEnvironment` with Meteor's public API.
2013-11-27 20:01:29 -08:00
Andrew Wilcox
d888cab5e6 Remove remaining references to login token from livedata. 2013-11-27 20:01:29 -08:00
Andrew Wilcox
04b39b0d30 Implement Meteor.server.onConnection and SessionHandle. 2013-11-27 20:01:29 -08:00
Naomi Seyfer
e58156bd58 Handle long-polling sockets when we are shutting down the server with SIGHUP better 2013-11-27 15:28:28 -08:00
karayu
7372c4cd05 added meta description 2013-11-26 15:34:03 -08:00