In order to test this, we applied the following diff to
minimongo/selector.js:
--- a/packages/minimongo/selector.js
+++ b/packages/minimongo/selector.js
@@ -591,6 +591,8 @@ ELEMENT_OPERATORS = {
},
$in: {
compileElementSelector: function (operand) {
+ if (operand === null)
+ operand = [];
if (!isArray(operand))
throw Error("$in needs an array");
This means that minimongo now allows `$in: null`, and thus
OplogObserveDriver can be used for the query in the new 'bad query'
test, but mongod still returns an error that is processed by the passing
test. (The client side of the test fails with this temporary change,
because minimongo no longer throws!)
It's hard to see how to test this better, because minimongo should throw
on any queries that mongod throws on.
Fixes#2534.
In the past, a bad query would be retried forever, causing the
observeChanges to hang.
(In the common case of a DDP subscription, this would also cause the
current DDP connection to completely stop reading messages, and would
make methods that do writes to the same collection (on ANY DDP
connection) never get their 'updated' messages. See
https://github.com/meteor/meteor/issues/2534#issuecomment-73355050
These two secondary problems may still need to be fixed but at least
the root cause should be addressed.)
This only fixes PollingObserveDriver, not OplogObserveDriver, but this
issue typically only affects PollingObserveDriver because we don't
choose to use OplogObserveDriver when minimongo can't understand a
query.
This is one of a longer sequence of changes we can make to make
the diffing algorithm in Blaze be linear as opposed to quadratic
which it is at the momeny, in general.
This change specifically makes it so that the very common case of
an {{#each}} over an array that switches from empty to a long array
much faster, since the adds in those case are always at the end
of the array. This means there's no bookkeeping necessary to
update indexes.
This changes reduces the rendering time from the example posted
on #3596 from 5000ms to 1729ms.
The logic to figure out which build dirs are temp dirs which need to be
freed and which are not was wrong, since it missed the non-temp
files.pathResolve(files.pathDirname(packagePath),
packageLinkTarget));
Use a more explicit way of tracking this.
(Fixed merge conflict when merging from devel.)