Skip to content

fix error blocking creation of new special classes #2035

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
4 tasks done
KodeDave opened this issue Feb 10, 2022 · 3 comments · Fixed by #2036
Closed
4 tasks done

fix error blocking creation of new special classes #2035

KodeDave opened this issue Feb 10, 2022 · 3 comments · Fixed by #2036
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@KodeDave
Copy link
Contributor

New Issue Checklist

Issue Description

SpecialClasses from /lib/Constants.js already have the '_' prefix, so adding it will send a double underscore to the Parse server (e.g.: '__Installation' instead of '_installation'), which resolves in an Invalid classname error, based on the SchemaController's function 'validateNewClass'

Steps to reproduce

On the sidebar, Browser section, click on "Create a class" button, select a special class (_Installation, _Product etc.), then click on 'Create class' or 'Create class & add columns'

Actual Outcome

Nothing happens on dashboard, and on the console an error appear from the parse server announcing an invalid classname

Expected Outcome

parse server creates the new class and the dashboard updates with this class

Environment

Node.js 16.13.2
parse 3.4.1

Dashboard

  • Parse Dashboard version: 4.0.0
  • Browser (Safari, Chrome, Firefox, Edge, etc.): Chrome
  • Browser version: 98.0.4758.80 (Official build) (arm64)

Server

  • Parse Server version: 4.10.4
  • Operating system: Ubuntu 20.04
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): VPS with Plesk

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.4.12
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Logs

Uncaught (in promise) Error: Invalid classname: __Installation, classnames can only have alphanumeric characters and _, and must start with an alpha character

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza
Copy link
Member

mtrezza commented Feb 10, 2022

Makes sense, that may be due to #1878 where we started displaying the internal classes with their correct names (including leading underscore).

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Feb 10, 2022
@mtrezza mtrezza linked a pull request Feb 10, 2022 that will close this issue
5 tasks
@mtrezza
Copy link
Member

mtrezza commented Feb 10, 2022

Closing via #2036

@mtrezza mtrezza closed this as completed Feb 10, 2022
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

Successfully merging a pull request may close this issue.

2 participants