Commit Graph

2790 Commits

Author SHA1 Message Date
David Glasser
e042e5a85a Fix "drop collection" test failure
There was a race condition in the manipulation of the write fence by the
drop collection code. Specifically, when seeing a "drop collection"
oplog entry, OplogObserveDriver took no immediate action and instead
deferred some "should I re-poll now or later?" logic.

This allowed the write fence's oplogHandle.waitUntilCaughtUp code to
think that everything was "caught up" even though the effects of the
"drop collection" entry had not yet affected the cursor's state (by
transitioning it away from the STEADY state).  The fix is to ensure that
the state-change aspects of processing the entry occur immediately; the
actual re-query is still deferred in order to not block the oplog tailer
from continuing.

Reported by: @awwx

(The previous failure can made consistently reproducible by replacing the
`Meteor.defer` that is removed by this commit with a
`Meteor.setTimeout(,200)`.)
2013-12-16 17:42:51 -08:00
David Glasser
cce9d36dfa Add some XXX comments about when we should re-poll 2013-12-16 17:42:49 -08:00
Nick Martin
a6c8b5eef3 Give up on documenting facts current api. 2013-12-15 19:40:57 -08:00
David Glasser
2991ac9312 fix missing expect() call in password-tests
add a console.trace that helps debug it
2013-12-15 17:17:33 -08:00
David Glasser
2f745bb52f Test changing Date and ObjectID 2013-12-15 17:17:25 -08:00
Nick Martin
20e8e4241c Retry subscription on error. 2013-12-15 17:17:17 -08:00
Nick Martin
8b37c0084d Make facts automatically subscribe when you show the template.
Also, namespace the collection and subscription name.
2013-12-15 17:17:09 -08:00
David Glasser
fd215633cc Make observe driver facts names consistent 2013-12-15 17:16:59 -08:00
David Glasser
71ca231c2b Take out check that can fail during failover 2013-12-12 23:54:46 -08:00
Nick Martin
a5d5a03189 Apply patch to node versions 0.10.22 and 0.10.23.
0.10.23 just came out and hasn't made any changes to the streams
stuff we patch.
2013-12-12 23:54:32 -08:00
David Glasser
5ebf0f2ec3 Avoid 100% CPU in tailing during Mongo failover 2013-12-12 23:54:22 -08:00
David Glasser
a244430f31 Handle modifications to EJSON custom types
OplogObserveDriver cannot try to directly apply these
representation-level mutations; it needs to get the entire custom type.

This implementation is overly conservative, but in practice
Meteor-originated writes shouldn't mutate EJSON custom types
anyway (they should treat them as atomic).
2013-12-12 23:53:44 -08:00
Nick Martin
506fb6a552 Also upgrade uglify-js. 2013-12-11 18:57:30 -08:00
Slava Kim
13c9de24b3 Upgrade clean-css to 2.0.2 2013-12-11 17:48:58 -08:00
David Glasser
8de0ae58dc tinytest: test.equal should use EJSON.equals 2013-12-11 17:42:04 -08:00
David Glasser
8c5ebca0d9 Ensure that we ignore old fetches when we repoll 2013-12-11 15:07:15 -08:00
David Glasser
ff7c35c5a3 "drop collection" support in oplog tailing
This version should be more correct than the previous implementation.
2013-12-11 13:50:24 -08:00
Nick Martin
49b7e45295 Package metadata updates.
Make autopublish internal, as it is part of standard-app-packages
and not something we want users to think about.

Tweak the string for facts package. 'and custom' was a bit awkward.
2013-12-11 03:26:13 -08:00
David Glasser
28b8c541a9 oplog: Don't transform query results 2013-12-11 00:53:55 -08:00
David Glasser
878cd8d4ae Ensure new test passes with --disable-oplog 2013-12-11 00:34:16 -08:00
David Glasser
3dd3bd3bca Get all relevant fields during initial query 2013-12-11 00:15:09 -08:00
David Glasser
b611db51c2 Implement _pollQuery. Don't call it. 2013-12-11 00:15:09 -08:00
David Glasser
82d5fcabf8 Work around Node issue #6506.
We were previously doing this with a fork of Node in the dev bundle, but
that wouldn't help users in production.

We now expect users to use precisely v0.10.22 in production. When new
versions of Node come out, if users choose to use them before we get a
chance to put out a new Meteor, we disable websockets to work around the
most common effect of the issue instead of monkey-patching.
2013-12-10 19:05:02 -08:00
Slava Kim
9fefc349e0 Make 'satellite' a special key in logging 2013-12-09 13:56:04 -08:00
David Glasser
163dccf5e7 Make _currentlyFetching null unless FETCHING 2013-12-06 18:36:54 -08:00
David Glasser
76bf0be8ca Remove an unnecessary Fiber. 2013-12-06 18:32:25 -08:00
David Glasser
1ebcd84811 Test for #1659 2013-12-06 14:27:12 -08:00
Mitar
30e709006e Fix so that it is really possible to pass null to disable transformation in validators. 2013-12-06 14:16:46 -08:00
Nick Martin
1eff62f0f3 Only count files that actually go in the cache in the cache size check. Fixes #1653. 2013-12-06 14:10:19 -08:00
Emily Stark
6eccf8cbbb Add an optional prefix for bundled js and css files.
Set it with `WebAppInternals.setBundledJsCssPrefix(prefix)`.
2013-12-05 17:52:35 -08:00
Nick Martin
6a2c952cd5 Use an object instead of an array to store connection callbacks. This way we can ensure a callback is never called after its stop handle is called. 2013-12-05 13:14:11 -08:00
Nick Martin
8f05510b59 Make onClose fire immediately instead of never on already closed connection. 2013-12-05 13:14:11 -08:00
Nick Martin
8ca859b786 safety belts. 2013-12-05 13:14:11 -08:00
Nick Martin
d4761610da need to pass through variable that is used. 2013-12-05 13:14:11 -08:00
Nick Martin
0a0059d081 typo. 2013-12-05 13:14:10 -08:00
Nick Martin
496936d21a review part 1: docs, style, etc. 2013-12-05 13:14:10 -08:00
Nick Martin
76c78645ff Rename this.session to this.connection. 2013-12-05 13:14:10 -08:00
Nick Martin
91ad6c0189 Remove trailing whitespace. 2013-12-05 13:14:10 -08:00
Nick Martin
f328079780 Rename establishConnection to be more test-y. Also comment on inappropriate placement. 2013-12-05 13:14:10 -08:00
Nick Martin
9181de2d1e Move StubStream from test-helpers to livedata. It is only used in livedata tests. 2013-12-05 13:14:10 -08:00
Nick Martin
3229b36578 Make test more robust to other tests leaving things in a bad state. 2013-12-05 13:14:09 -08:00
Nick Martin
d1cb3742f3 Remove email stubbing code that wasn’t safe for running multiple times on the server. 2013-12-05 13:14:09 -08:00
Nick Martin
1bd2976206 Rework tests that didn’t work when multiple clients run at once. 2013-12-05 13:14:09 -08:00
Andrew Wilcox
46afaec215 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`.
2013-12-05 13:14:09 -08:00
Andrew Wilcox
614d91b6b0 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-12-05 13:14:06 -08:00
Andrew Wilcox
c1d97fde7c Also make the session available in publish functions. 2013-12-05 13:11:40 -08:00
Andrew Wilcox
67a589be8b Fix session handle tests so that multiple copies of the test can run
at the same time.
2013-12-05 13:11:40 -08:00
Andrew Wilcox
72eded7e2f Check that the connection hasn't been closed already before calling
the onConnection callback.
2013-12-05 13:11:39 -08:00
Andrew Wilcox
6462e2dae9 Alias Meteor.server.onConnection to Meteor.onConnection 2013-12-05 13:11:39 -08:00
Andrew Wilcox
41f44b1ad6 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-12-05 13:11:39 -08:00