Commit Graph

6202 Commits

Author SHA1 Message Date
David Glasser
de9d28adcc Fix non-array fields with array fields 2014-03-11 11:50:03 -07:00
David Glasser
bf32d79227 a more direct _generateKeysFromDoc unit test 2014-03-11 11:50:03 -07:00
David Glasser
0876ed46a2 Make sorter closer to Mongo sort key semantics
Specifically, this ensures that with sort specifier {'a.x': 1, 'a.y': 1},
{a: [{x: 0, y: 4}]} sorts before {a: [{x: 0, y: 5}, {x: 1, y: 3}]} by
ensuring that the latter only has sort keys [0,5] and [1,3], and not
[0,3].

It does this by ensuring that the different fields used to generate a
sort key are only matched up if they use the same "path" (series of
array indices used during lookup).  This is a little stronger than what
MongoDB does: MongoDB lets you do {'a.x': 1, 'a.y.z': 1} where 'a' and
'a.y' are both arrays, and our new rule requires all fields to have
either the exact same set of arrays or to use no arrays at all.

(MongoDB does still have some constraints; eg, with sort key {a: 1,
b:1}, a and b cannot both be arrays.  Basically, there may be at most
one "outermost" array across all the fields; and so on recursively, sort
of.

The previously failing test passes now.
2014-03-11 11:50:03 -07:00
David Glasser
ed47055526 Key-based sort.
This rewrites the sorter to generate "keys" for each doc and find the
lexicographically minimum "key", rather than to look at each sort key
field separately.

This commit doesn't actually change the semantics (and the failing test
still fails) because the key generator actually still computes the full
cartesian product of all keys, rather than only using fields that are
next to each other in arrays.
2014-03-11 11:50:03 -07:00
David Glasser
95e4cad3c6 Failing test-case for a sort bug 2014-03-11 11:50:03 -07:00
David Glasser
ee7230dadd Drop Sorter name and use _.extend for prototype
Should be a no-op.
2014-03-11 11:50:03 -07:00
David Glasser
2601b3b8ea minimongo: Save all array indices, not just first
This 'x' thing is a bit of a hack. The idea is that there are two
consumers of arrayIndices. One is '$', which only looks at the first
index. The other is (soon) sort ken generators, which cares if indices
are explicit or implicit, but doesn't really need to "parse"
arrayIndices; it just will use them to associate branches from different
lookup functions with the matching arrayIndices.  'x' is a simple way to
accomplish this, though I could have made the values of arrayIndices be
objects too.
2014-03-11 11:50:03 -07:00
Avital Oliver
b25d765b3e Remove unused Deps._makeNonreactive 2014-03-10 15:55:37 -07:00
Avital Oliver
46964c77e6 Improve Deps performance by not using _.bind 2014-03-10 15:54:43 -07:00
David Glasser
57104f6a8d Better error handling around a method call
- Make sure not to double-resolve a future (using two different
  techniques!)

- Try/finally cleanup some resources
2014-03-05 13:32:31 -08:00
Slava Kim
53f2b73d6f Merge branch 'oplog-limits-buffered' into devel 2014-03-03 23:28:54 -08:00
David Glasser
0791b31b30 dev bundle: fork node-http-proxy to fix #1871 2014-03-03 23:15:41 -08:00
David Glasser
6069da6427 Update facebook config instructions. 2014-03-03 23:15:30 -08:00
Nick Martin
a1fed0caaa Comment only. Record idea about unblocking subs. 2014-03-03 22:49:49 -08:00
Nick Martin
8924417e23 More correct pattern for publishing user.
Long, but probably better to show the pedantically correct thing so users don't
get hurt if they copy, paste and modify.

Fixes #1885
2014-03-03 22:41:33 -08:00
Nick Martin
f9c947a749 Print when we're listening, for use in automated tests. Fixes #1884. 2014-03-03 22:17:40 -08:00
Tim Haines
f079efe48b Update the instructions for creating a Google Client ID 2014-03-03 22:00:31 -08:00
David Glasser
c0447737ec Fix less error handling during ast.toCSS
Fixes #1877
2014-03-03 21:55:58 -08:00
rgould
51148c84df Update AmplifyJS from 1.1.0 to 1.1.2 2014-03-03 21:21:39 -08:00
Nick Martin
f97b00f7ee clean up example in docs. #1854 2014-03-03 21:13:51 -08:00
Tim Haines
e356c23fdb Make factsByPackage data available to the server environment 2014-03-03 21:11:57 -08:00
David Glasser
06267daa93 Comment: we only partially do AJAX crawling spec
Fixes #487
2014-03-03 20:55:37 -08:00
David Glasser
a2d73ca9bf Revert "Make paths relative in .gitignore"
This reverts commit f933b7f97f.

This is sadly not how gitignore works.
2014-03-03 15:35:43 -08:00
Slava Kim
f933b7f97f Make paths relative in .gitignore
Some tools like `ag` don't work well with absolute paths but work well with
relative ones. Considering that this project-wise '.gitignore' stays in root, it
will be OK to change the paths to relative.
2014-03-02 19:12:03 -08:00
David Glasser
1cb76e1088 Merge branch 'devel' into oplog-limits-buffered 2014-03-01 18:21:52 -08:00
Slava Kim
e4c5f6ac97 Oplog limits test: big initial set, repolls, safeToAppend flag release/oplog-limits-preview-1 release/oplog-limits-preview 2014-03-01 01:13:00 -08:00
David Glasser
89a96084b8 history update 2014-02-28 23:15:33 -08:00
David Glasser
bd05fdb2c5 minimongo: support semi-logical $elemMatch
ie, a document with some logical operator and some equality in an
elemMatch.

eg: {a: {$elemMatch: {x: 1, $or: [{a: 1}, {b: 1}]}}}

Fixes #1875.
2014-02-28 23:13:11 -08:00
Slava Kim
6c595e7b8d A remove a redundant clone 2014-02-28 21:42:51 -08:00
Slava Kim
1fef6e5662 Factor out published/buffer renewal into _runQuery
Fixes the bug when the buffer is empty on the first run if the size of query is more than limit*2
2014-02-28 18:18:09 -08:00
Slava Kim
c615ec11ef Move the comment 2014-02-28 16:51:09 -08:00
Slava Kim
29ebdbfeae Sophisticate the tests for oplog + limits + sorter 2014-02-28 14:34:44 -08:00
Slava Kim
571ba01f16 Use new sorter + projection api in oplog code 2014-02-28 14:25:33 -08:00
Slava Kim
c14e41a0d7 Simple tests on Sorter.combineIntoProjection 2014-02-28 14:22:30 -08:00
Slava Kim
a96243e746 Sorter.combineIntoProjection is an instance method
Reuse existing sort spec parsing, store sort spec explicitly with key-paths. Elide numeric key in Sorter._getPaths
2014-02-28 14:16:10 -08:00
David Glasser
3ebc9aba60 arguably support empty regexs in file watcher 2014-02-28 11:59:03 -08:00
David Glasser
45db64d4bf Support {a: {$regex: '', $options: 'i'}}
Fixes #1874.
2014-02-28 11:58:29 -08:00
David Glasser
dcf806f852 typo in history 2014-02-28 11:52:44 -08:00
David Glasser
d049bf7506 Use faye-websocket for server-to-server DDP
This matches what the SockJS server uses; now we only need to understand
and fix bugs in the implementation of one websocket npm module.

Some notes:

  - I actually trust that it's possible to close a connection before it
    successfully connects, which allows me to simplify the code a
    lot (since there shouldn't be multiple connections active per
    ClientStream). I put in some assertions to make sure this is the
    case, though.  (Note that this module also has a simpler model,
    where there's a single object representing the client connection,
    not a "client" object that spawns "connections".)

  - We now print connect errors as well as post-connect errors.  (This
    required adding a flag to keep tests quiet since it makes an
    expected-to-fail-to-connect connection.)  We need a better approach
    to stream error handling, though.

  - We used to have a test to make sure that a certain not-user-visible
    callback is called within a Fiber; structuring the code such that
    this test is still possible would lead to the code being less
    consistent and harder to read, so I dropped the test.

  - Fix a few bugs where we weren't using Meteor.setTimeout.
2014-02-27 15:20:43 -08:00
Emily Stark
9c1dc8782c Clean up ServiceConnection timer when we receive a result.
Previously, we could make a connection, do some method calls, and then
10 seconds later the connection happens to be dropped and the connection
timer fires, which not only throws an unexpected error into the future,
but also resolves the future twice. I think ServiceConnection is just
supposed to time out if you don't hear anything from the server within
10 seconds, so it now no longer times out if you hear things from the
server but then happen to be not connected when 10 seconds has elapsed.
2014-02-27 08:09:31 -08:00
Emily Stark
bc4524b544 Set up onReconnect after initial sub on the connection to log-reader.
If we set it up before `subscribeAndWait` returns, then we'll end up
with two subscriptions; we don't have the log-reader sub yet, so we
can't stop it when `onReconnect` runs the first time, so we end up with
a redundant subscription. This means that if a real reconnect happens
later, we'll stop the sub that we set up inside `onReconnect`, but not
the initial sub, so we've leaked a sub and end up with duplicate
messages after reconnect.
2014-02-27 07:56:36 -08:00
Emily Stark
9d5782b9a0 Return the sub from ServiceConnection.subscribeAndWait 2014-02-27 07:56:19 -08:00
Emily Stark
35c1a5fc45 Replace subscribeAndWait with subscribe inside onReconnect 2014-02-26 23:57:18 -08:00
Emily Stark
825082b3a8 Add missing semicolon in deploy-galaxy 2014-02-26 23:49:18 -08:00
Slava Kim
85ba085c78 Oplog code takes sorter fields into shared projection 2014-02-26 18:45:25 -08:00
Slava Kim
b3548e5437 Combine sorter spec with projection 2014-02-26 18:44:24 -08:00
Nick Martin
4a0d1b7363 Merge branch 'master' into devel 2014-02-26 17:58:37 -08:00
Nick Martin
4555d2c8e4 Merge branch 'release-0.7.1.2'
Conflicts:
	History.md
	docs/.meteor/release
	docs/lib/release-override.js
	examples/leaderboard/.meteor/release
	examples/parties/.meteor/release
	examples/todos/.meteor/release
	examples/wordplay/.meteor/release
	scripts/admin/banner.txt
2014-02-26 17:57:39 -08:00
Emily Stark
b0d86e535c Update docs and examples 2014-02-26 17:48:17 -08:00
Slava Kim
7948c0f38b Test for preserving fields needed for sort 2014-02-26 17:09:16 -08:00