Skip to content

Fix sign up user in cloud function #7351

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

Open
wants to merge 4 commits into
base: alpha
Choose a base branch
from

Conversation

Yurgal
Copy link

@Yurgal Yurgal commented Apr 16, 2021

New Pull Request Checklist

Issue Description

Trying to logIn a user using the masterKey and the installationId without using the password

Related issue: #6641

Approach

TODOs before merging

  • Add test cases

@mtrezza mtrezza changed the title Adding failling test Fix signup user in cloud function Apr 16, 2021
@mtrezza mtrezza changed the title Fix signup user in cloud function Fix sign up user in cloud function Apr 16, 2021
@mtrezza
Copy link
Member

mtrezza commented Apr 16, 2021

@Yurgal You can click on "Details" to open the test log and see why it failed:

  • CI self check has nothing to do with your PR, bump CI env #7352 fixed that --> if you rebase on master or merge master into your branch, it should pass.
  • The others fail because of your failing test ;)

@@ -4031,4 +4031,30 @@ describe('Security Advisory GHSA-8w3j-g983-8jh5', function () {
const user = await query.get('1234ABCDEF', { useMasterKey: true });
expect(user.get('authData')).toEqual({ custom: { id: 'linkedID' } });
});

describe('issue #6641', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you either move the test into an existing describe group where this fest fits thematically, or if there is no such group, rename this describe group with a short description as you see in the other groups?

If I understand correctly, since the focus here is on auth via cloud code, I would see this test rather in an auth or cloud code spec file. Can you take a look whether there are any tests in auth files that are similar to what you are testing? That would be an indication that your test belongs there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it in Auth

})
.then(() => done())
.catch(() => {
fail();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need any fail(), done(), these should be avoided when possible.

Copy link
Author

@Yurgal Yurgal Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to properly handle the catch issue without fail()

Copy link
Member

@mtrezza mtrezza Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • for exceptions use expect().toThrow()
  • for promise rejections use expect().toBeRejected()

@Yurgal
Copy link
Author

Yurgal commented Apr 19, 2021

hi @mtrezza

I added a new test. As explain in the java documentation, getSessionToken() using the master key should not return undefined. getSessionToken

@dplewis
Copy link
Member

dplewis commented Jun 3, 2021

@Yurgal You have to signUp with the installationId otherwise how will login find the user? See tests cases https://github.com/parse-community/Parse-SDK-JS/pull/1031/files

@mtrezza
Copy link
Member

mtrezza commented Sep 3, 2021

⚠️ Important change for merging PRs from Parse Server 5.0 onwards!

We are planning to release the first beta version of Parse Server 5.0 in October 2021.

If a PR contains a breaking change and is not merged before the beta release of Parse Server 5.0, it cannot be merged until the end of 2022. Instead it has to follow the Deprecation Policy and phase-in breaking changes to be merged during the course of 2022.

One of the most voiced community feedbacks was the demand for predictability in breaking changes to make it easy to upgrade Parse Server. We have made a first step towards this by introducing the Deprecation Policy in February 2021 that assists to phase-in breaking changes, giving developers time to adapt. We will follow-up with the introduction of Release Automation and a branch model that will allow breaking changes only with a new major release, scheduled for the beginning of each calendar year.

We understand that some PRs are a long time in the making and we very much appreciate your contribution. We want to make it easy for PRs that contain a breaking change and were created before the introduction of the Deprecation Policy. These PRs can be merged with a breaking change without being phased-in before the beta release of Parse Server 5.0. We are making this exception because we appreciate that this is a time of transition that requires additional effort from contributors to adapt. We encourage everyone to prepare their PRs until the end of September and account for review time and possible adaptions.

If a PR contains a breaking change and should be merged before the beta release, please mention @parse-community/server-maintenance and we will coordinate with you to merge the PR.

Thanks for your contribution and support during this transition to Parse Server release automation!

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

Successfully merging this pull request may close these issues.

3 participants