-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datastore client not getting ProjectID from env #1092
Comments
Good catch, thanks for letting us know. PR incoming! |
im not sure if other clients also have this problem. I though they all extend the same base class? |
I checked, all of the other APIs do it. @callmehiphop can you think of a way we can move the normalizing to the Service constructor? |
@stephenplusplus we should be able to just normalize them in the Service constructor, no? |
I think there might be an issue with double-instantion? On Thu, Jan 28, 2016, 11:01 AM Dave Gramlich [email protected]
|
|
Using this as an example: https://github.com/GoogleCloudPlatform/gcloud-node/blob/30817fcc10195da0136baefeb38b225986fb1c7e/lib/storage/index.js#L87-L90 if (!(this instanceof Storage)) {
options = util.normalizeArguments(this, options);
return new Storage(options);
} Why do we only normalize if it's not an instance of Storage? |
Related: #845 (comment) |
If the current context is not an instance of a service (e.g. |
So I'm wondering, since we only normalize under that condition, how do we move that logic to the Service constructor? |
Ahh right, not sure if there's a way around that.. we might have to re-think things a little bit if we want to try and refactor that logic into the |
Should we just leave it? |
Might be a good idea for now? |
It looks like Datastore client is not getting the projectID from the env automatically.
This works fine, but:
returns:
This fixes the problem
The text was updated successfully, but these errors were encountered: