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.
Fixes#3730.
Testing Done:
Manual testing based on the report in #3730. Also confirmed that `</script>` is not a problem.
I would have added a test-packages test but there's no easy way to override Meteor.settings in test-packages.
Bugs closed: 3730
Reviewed at https://rbcommons.com/s/meteor/r/1/
A merge of the windows-cordova branch did not increment the version numbers
of some packages before adding pre-release versions. This causes constraint
solver errors, when, for example, trying to build a release from devel. This
change should fix the most obvious candidates.
ie, when processing each oplog entry, don't even look at the triggers
from unrelated collection.
Also, just make "every trigger and notification needs a string
collection" into a hard rule.
This is apparently much faster for at least one real user; see #3697.
Summary: should be self-contained and documented
Test Plan: unit tests
Reviewers: ekatek
Differential Revision: https://phabricator.meteor.io/D29