Inspired by a pull request from tmeasday (though we've changed the underlying
code enough on ddp-pre1 that I had to rewrite it myself).
Use it in todos. No docs yet, but the Meteor.subscribe docs are already
scheduled for some attention.
Note that sub.stop() is now handled by the client (it removes the record of the
subscription) but there is no way for an app to observe this. (I expect we'll
use sub.stop() in implementing "fetch" in the Mongo connector.)
This callback receives any terminating error from a subscription. Currently this
can only be because the subscription is unknown, but soon subscriptions will be
able to send other errors.
Also, adjust the semantics of ready callbacks in a reactive context to only call
the latest instance of the callback rather than all callbacks.
Now don't require _id to be unset on insert anymore.
Some error handling around duplicate _id
Conflicts:
packages/minimongo/minimongo.js
packages/mongo-livedata/collection.js
packages/mongo-livedata/mongo_livedata_tests.js
reactive status object and don't try to reconnect.
Note that this only happens if the server rejects the connection due to an
unfixable version mismatch: if the server is unreachable or not speaking
versioned DDP, the client will continue to retry.
This definitely won't "work" because both have API changes.
UglifyJS 1 was having issues minifying certain code (eg lodash). But UglifyJS 2
was occasionally segfaulting (as was other code using large regexps). See the
bottom of https://github.com/laverdet/node-fibers/issues/89
Hopefully this will fix it.
Instead of a general client-side sub de-duping mechanism (which mostly existed
for the sake of autosubscribe, and causes issues with server-driven
unsubscribes), make Meteor.subscribe explicitly aware of reactivity.
Expose an "invalidated" flag on Meteor.deps.Context.
Guarantee that invalidation callbacks from different contexts will not be
interleaved at flush time. This has the implication that if you do
context1.onInvalidate(function () {
context2.invalidate();
});
and this is the only way to invalidate context2, then context2's invalidation
callbacks will not be called until after *ALL* of context1's callbacks are
called. This allows us to be sure that the "unsubscribe, unless autorun tried to
re-create an identical sub" logic runs after the autorun function is rerun.