Summary:
Previously, the MongoConnection constructor (which gets called
implicitly the first time you make a Mongo.Collection) would wait for a
successful connection before returning ... if an oplog URL is supplied.
If not in oplog mode, it would return before the connection is
successful, and the first subsequent calls that actually tried to do
something with the DB would block instead.
Having an inconsistent API that is sometimes sync and sometimes async is
not very clear. Moreover, error handling from connect was strange.
Prior to 0.8.1 (24a0006c), connect errors would be thrown
uncatchably (ie, from an unrelated context). Starting with 0.8.1,
connect errors would effectively be ignored due to the new
bindEnvironment (they'd be logged, but all code would continue
normally).
It's pretty important that startup connection errors crash the server
process instead of letting it keep running unproductively. And it would
also be nice if those errors could be caught (if you're making a
MongoConnection in your own code). So this change ensures that
connection errors get thrown by the MongoConnection constructor.
Fixes#3038.
Test Plan: new unit test. manual test with MONGO_URL=xxx
Reviewers: ben
Subscribers: justinsb
Differential Revision: https://phabricator.meteor.io/D19
Nothing ever made full use of the promise of the complexity of the
API (configuration that can change at runtime) anyway.
This includes completely ignoring the $APP_CONFIG variable.
I opened GitHub issues against the only Atmosphere packages that had
dependencies on application-configuration (none of which actually used
the package other than by declaring the dependency).
So far I have only removed files from packages that are included by
default in newly `meteor create`d projects. We should probably make a pass
over all the core packages, too.
'oauth' was using 'btoa', but it's not supported in IE8-9. We already
had a base64 implementation in 'ejson', so I factored it out into its
own package used by 'ejson' and 'oauth'.
Summary:
To bind the wrapped function to an object, just pass that object as the
optional second argument to Meteor.wrapAsync:
var response = Meteor.wrapAsync(HTTP.get, HTTP)("http://example.com");
Test Plan: meteor test-packages meteor
Reviewers: emily, avital, sashko
Reviewed By: emily
CC: nim
Differential Revision: https://phabricator.meteor.com/D807