Skip to content
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

Parse Cloud function validation crashes server #9172

Open
NabilPopo opened this issue Jul 1, 2024 · 7 comments
Open

Parse Cloud function validation crashes server #9172

NabilPopo opened this issue Jul 1, 2024 · 7 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@NabilPopo
Copy link

NabilPopo commented Jul 1, 2024

Hello community,

I find a bug when I want to validate email format from input,
sdsd

Also it crashed when it returns false
sdsdsd

Copy link

Thanks for opening this issue!

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Jul 1, 2024
@mtrezza
Copy link
Member

mtrezza commented Jul 1, 2024

Could you create a failing test that demonstrates the issue?

@mtrezza mtrezza changed the title Cloud Parse function alidation input crash the server Parse Cloud function validation input crashes server Jul 1, 2024
@mtrezza mtrezza changed the title Parse Cloud function validation input crashes server Parse Cloud function validation crashes server Jul 1, 2024
@NabilPopo
Copy link
Author

NabilPopo commented Jul 1, 2024

Hello again,

Here I provide another basic example more simple to re-produce the problem

  1. parse
    Parse.Cloud.define("test", async(request)=>{ return 'hello' }, { fields: { firstname: { required: true, type: String, options: val => val > 2 }, lastname: { required: true, type: String, options: val => val > 2 }, gender: { required: true, type: String, options: val => ['male', 'female'].includes(val) } }, requireUser: true }, )

  2. the request body, try these examples:
    { "firstname": "", "lastname": "" }
    { "firstname": "sdfdf", "lastname": "" }

Like so:
aa

Thank you!

@mtrezza
Copy link
Member

mtrezza commented Jul 8, 2024

Thanks, would you want to open a PR with that test?

@mtrezza
Copy link
Member

mtrezza commented Jul 22, 2024

@Priyanshu085 Sure, would you want to start by creating a PR with a failing test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants
@mtrezza @NabilPopo and others