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

API needs to guard the programmatic creation of models so that it doesn't allow the same name to be used #2522

Open
timruppert opened this issue Jul 6, 2022 · 1 comment

Comments

@timruppert
Copy link

Version

5.28.0

Operating System

Mac Monterey

Browser

Chrome (new)

What steps will reproduce the bug?

This is related to an issue that we raised about error handling when trying to create models. This was fixed on the front end and stops a user from using a model that's already been created - confirmed by @endymion1818 #2324

During our conversation, we went back and tested this on the newest version (partially because we ran into this again when trying to programmatically create a model during our tenant creation process). We had used the same name that you guys did for Tenant Settings - and did not receive an error when we programmatically created our own for this tenant.

The resulting issue is that the entire system does not work any longer until we located the records in Dynamo and deleted it by hand - then we were good to go again.

What is the expected behavior?

The expected behavior is that, at the API level, we should not fulfill a request to create another model with the same name since it causes this problem. The UI accomplishes this today successfully.

What do you see instead?

No response

Additional information

No response

Possible solution

I think it should be guarded so that new users don't run into this same issue - which, thankfully, Ostap knew how to fix quickly :) . This will fix the problem - but it's also maybe a good idea to make it so that the system doesn't crash if it somehow does sneak in there.

@timruppert
Copy link
Author

Original conversation from Ostap with @Pavel910 from April 12th at 10:17 AM

@Pavel910 we updated to 5.24.0 with HeadlessCMS fix for the issue I reported. But seems it doesn’t fix it fully. It does not allow to create a model with name “TenantSettings” as it exists in the schema, but “Tenant Settings” works for this validation but crash the schema.

image
image (1)

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

1 participant