Skip to content

v1.11.0 -- useMasterKey in beforeSave #524

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

Closed
christianpbrink opened this issue Dec 4, 2017 · 11 comments
Closed

v1.11.0 -- useMasterKey in beforeSave #524

christianpbrink opened this issue Dec 4, 2017 · 11 comments

Comments

@christianpbrink
Copy link

It fails. Tells me the master key hasn't been provided. Never did this in previous versions; I've rolled back to 1.10.0 and it's working fine again.

@flovilmart
Copy link
Contributor

Can you provide a code example please?

@milesrichardson
Copy link

@christianpbrink Are you using postgres or mongo?

The parse-server repo has a PR from greenkeeper with failing tests for updated Parse-SDK-JS on postgres: parse-community/parse-server#4414 If you look at the errors, they are related to master key. Though I'm not familiar with these tests and those might just be warnings. But could be related.

@flovilmart
Copy link
Contributor

The failing test with Postgres was just a flaky test.
@christianpbrink, can you provide more details?

@christianpbrink
Copy link
Author

Sorry @flovilmart, I will try to get around to this. I've got other stuff on my plate today.

It was happening on any use of Parse.Query.find or Parse.Query.first with {useMasterKey:true} inside a .beforeSave hook.

@flovilmart
Copy link
Contributor

What's interesting is that parse-server isn't released yet with the JS SDK at 1.11.0.

@christianpbrink
Copy link
Author

Oh wait you mean that version of the JS SDK isn't even officially released yet? I had manually set a requirement for 1.11.0 in my project's package.json. Not sure where I got the idea that it was released.

@flovilmart
Copy link
Contributor

it is officially released, however, the Parse SDK dependency inside parse-server is not automatically updated as we pin all dependencies aggressively to prevent unexpected breaking changes.

If you pinned the parse SDK in your package.json, it is probable that Cloud Code would run the parse SDK from the relative node modules folder, and not the one you pinned at the top level.

You can easily check that the SDK is exposed at v1.11 by checking Parse.setAsyncStorage if it's undefined, you're still on the old one, if not, you're on the new one.

@christianpbrink
Copy link
Author

Hm. The problem definitely appeared as soon as I upped to 1.11.0 and vanished as soon as I reverted to 1.10.0. Of course it's possible this was due to some other change that I happened to make at the same time without noticing it.

@flovilmart
Copy link
Contributor

Perhaps the problem is that you're trying to use 2 versions of the Parse SDK within the same server.

@christianpbrink
Copy link
Author

Oh snap. Very possible. I will keep that possibility in mind when I revisit this. Thanks for the thought.

@flovilmart
Copy link
Contributor

I’ll close this one, also, 1.11 didn’t provide any change into this area. Please reopen the issue if it persists after next parse-server version is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants