Commit Graph

2359 Commits

Author SHA1 Message Date
Avital Oliver
7e8c2f9405 Better error when passing string to {{#each}}
Fixes #722
2013-09-23 17:49:59 -07:00
Naomi Seyfer
4f4e5342eb Remove code to keep around sessions after they are disconnected.
We will deal with reconnects with session resumption someday, but it will not be
using this dead code which has bitrotted in our repository for months on end.
It was never fully implemented, and what we had was a sketch that causes bugs
(and extra cpu usage).
2013-09-23 17:30:34 -07:00
Naomi Seyfer
35e8a04834 Stop offending the message. Dont alias in_queue to out_queue 2013-09-23 15:53:47 -07:00
Slava Kim
48eea25d27 Comments on keys sorting.
Suggested by Glasser.
2013-09-16 11:04:08 -07:00
Slava Kim
4345fdbd4b Always sort keys to simplify some cases.
And don't modify the argument.
2013-09-13 16:00:08 -07:00
Slava Kim
4ed373b2b4 Check the equality with _.isEqual
EJSON.stringify doesn't guarantee the order of keys.
2013-09-13 15:59:36 -07:00
Slava Kim
6c448a213f Another test 2013-09-13 15:41:53 -07:00
Slava Kim
2642280977 Put a.b.c and a.b validation into general case. 2013-09-13 01:51:25 -07:00
Slava Kim
a6643812a8 Same test but for blacklisting 2013-09-13 01:51:24 -07:00
Slava Kim
05a3a22a6b Fields with subsets passes the test. 2013-09-13 01:51:24 -07:00
Slava Kim
83136f64aa Add nested-nested test.
Taken from Glasser's old code-review.
2013-09-13 01:51:24 -07:00
Slava Kim
f6e307e644 Whitespace 2013-09-13 01:51:24 -07:00
Slava Kim
27fd0d5066 Support subsets fields filtering.
Rewrote the returned closure. Still don't support '$' and '$slice' operators.
2013-09-13 01:51:24 -07:00
Slava Kim
2e10d43041 Simple tests for sub-set projections. 2013-09-13 01:51:24 -07:00
Maxime Quandalle
c66b8e3db5 Style tweaks 2013-09-12 14:29:50 -07:00
Maxime Quandalle
8df6553ce2 Add a literate handler in the coffeescript package
Add .coffee.md handling tests
2013-09-12 14:29:50 -07:00
Andrew Wilcox
4714f892f5 Check that the argument to EJSON.parse is a string.
Some Android browser versions of JSON.parse can crash when passed null
(https://code.google.com/p/android/issues/detail?id=11973), so it's
better not to pass on a non-string argument to JSON.parse.

Thanks to @raix for raising the issue in #1401.
2013-09-12 12:13:15 -07:00
Emily Stark
0bc4bc9c26 Clean up token deletion and tests. 2013-09-11 13:44:27 -07:00
Emily Stark
d9093d6cf8 Test for logging out a user's connections when deleted.
Tests are flaky, not sure why yet.
2013-09-11 13:44:14 -07:00
Emily Stark
4ebdbd9f77 On logout, disassociate connection from token before deleting token. 2013-09-11 13:44:13 -07:00
Emily Stark
dab6df0eb9 Remove DDP disconnected message.
Instead, using a friendlier error message for bad login tokens, and preferring
localStorage tokens to the result of login method in onReconnect (since
onReconnect doesn't get cleared because we don't have a disconnected message to
know when to clean it). Also tried to make tests a little cleaner.
2013-09-11 13:44:13 -07:00
Emily Stark
09ba59c50b Close users' connections when they or their tokens are deleted. 2013-09-11 13:44:13 -07:00
Emily Stark
21dd57c95d Allow DDP client to register onDisconnect callback.
accounts-base uses this to handle disconnects due to users being intentionally
logged out.
2013-09-11 13:44:13 -07:00
Emily Stark
e84f0adb78 Add test for Meteor._logoutAllOthers.
Fix bugs to make it work.
2013-09-11 13:44:13 -07:00
Emily Stark
10d49451d9 Add experimental "disconnected" DDP message.
Client uses this to unset user id when a forced logout happens.
2013-09-11 13:44:13 -07:00
Emily Stark
8621c18bc1 Add token expiration test and fix bugs so it passes.
Also make all token-expiration-related times configurable via Accounts.config.
2013-09-11 13:44:13 -07:00
Emily Stark
2ebdeb0d95 Make token expiration times configurable via Accounts.config. 2013-09-11 13:44:13 -07:00
Emily Stark
d84334a34b Make client aware of token expiration times.
accounts-password will not try to auto-login with (and will clear) a login token
that is going to expire within an hour, to try to avoid abrupt disconnects from
an expiring token. Login handlers return a new tokenExpires field to help the
client do this. Made tokenExpires a separate field on the login handlers' result
object instead of just returning the whole token (token + when fields) in the
result to avoid breaking code that assumes that login handlers return a string
as the token field. The tokenExpires field is optional, so other login handlers
that don't set it aren't broken.
2013-09-11 13:44:13 -07:00
Emily Stark
d39726d737 Store login token on livedata session.
Allows us to remove sessions from sessionsByLoginToken when they are destroyed.
2013-09-11 13:44:13 -07:00
Emily Stark
1887d6960b Expire login tokens periodically.
When a login token expires, all open connections associated with that token will
be closed. It will be up to client code to avoid trying to connect with a login
token that is set to expire soon.
2013-09-11 13:44:13 -07:00
Emily Stark
4b7f052ce0 Wait 10 seconds before closing other logged-in sessions.
Gives other tabs sharing a token with the caller time to find the new token in
localStorage. This is sort of a hack for now; one possibility for making it less
hacky is to add a DDP disconnect message to allow the server to tell clients
that they are being disconnected but can reconnect with the provided token.
2013-09-11 13:44:13 -07:00
Emily Stark
12c0d8ef5e Rename to Meteor._logoutAllOthers 2013-09-11 13:44:12 -07:00
Emily Stark
3403b31c42 Preserve the connection that called logoutAll. 2013-09-11 13:44:12 -07:00
Emily Stark
7dfff264a3 Add method that logs the user out everywhere.
Might need some UI work; currently causes confusing error message "Couldn't find
login token."
2013-09-11 13:44:12 -07:00
Emily Stark
afa8afd9a9 Keep track of open DDP connections by login token. 2013-09-11 13:44:12 -07:00
Andrew Wilcox
ba34b2550b Chrome for iOS supports the appcache 2013-09-04 16:31:52 -07:00
Mitar
e082d9745a Check for err.stack in logErr in wrapAsync. 2013-08-31 10:03:41 -07:00
Nick Martin
c4203e3500 Fix typo in package description. 2013-08-26 19:28:25 -07:00
Emily Stark
aa291537a4 Update tests for new Date fields on user docs 2013-08-21 14:28:50 -07:00
Emily Stark
14da1c3ad2 Use Date for login token timestamps 2013-08-21 14:28:33 -07:00
Emily Stark
8160ce549b Merge branch 'isodate-to-mongo' of github.com:ryw/meteor into mongo-dates
Conflicts:
	History.md
2013-08-21 14:17:29 -07:00
Emily Stark
9547ac2b9f Rename _suppress_ordered to _allow_unordered. 2013-08-20 18:31:08 -07:00
Emily Stark
6f02ee6098 Merge branch 'meteor-issue-654' of github.com:nathan-muir/meteor into issue-654 2013-08-20 18:25:43 -07:00
Nick Martin
1e9a61eff6 Mark application-configuration as internal. People don't need to add it. Plus, the name is long enough to throw off 'meteor list' 2013-08-20 14:48:22 -07:00
Emily Stark
008c1cf7f2 Use decoded pathnames in staticFiles keys.
Fixes #1339
2013-08-20 11:37:11 -07:00
Emily Stark
8b13f53cf4 Fix d3 tab character 2013-08-20 11:08:50 -07:00
David Glasser
0088475699 More comments on idStringify fix. 2013-08-19 22:15:52 -07:00
David Glasser
3cfeed5b5b Various bugs involving idStringify.
In minimongo, we support various types as _id fields; the most important are
strings and ObjectIds. We have a special encoding that we use when we need to
represent them as strings, but we had a few bugs with using it.

minimongo: The duplicate-ID check in insert needed to check using the encoded
string.

spark OrderedDict: due to linker changes, it was not successfully finding
LocalCollection._idStringify, and so it fell back to the identity
function. Fixed to use weak dependencies. Also, later refactorings have removed
the need for idStringify(null) === null so that special case is removed.

spark branch labels: use idStringify in various places where _id is used as a
branch label.
2013-08-19 22:00:37 -07:00
Nick Martin
30b08fc012 Export Spiderable symbol, so people can override user agents. Also add twitterbot to agents. Fixes #1300. 2013-08-19 19:51:01 -07:00
Nick Martin
dff1310cc4 Upgrade stylus to 0.37.0 and nib to 1.0.0. Fixes #1121, #1315.
Tested by:
- run unit tests
- create an app, add stylus package.
- add foo.style file that uses nib and a background gradient
- see appropriate css generated in app with web inspector.
2013-08-19 19:27:58 -07:00