-
Notifications
You must be signed in to change notification settings - Fork 75
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
Should idGenerationMode=ServerAndClientGenerated show more then throwing a 500 on 'duplicate key' #2082
Comments
Another observations (not sure if this intended?):
Is this intended? I can think of 2 scenario's:
Any idea about this? |
When using a client-supplied id, a check to see if this id already exists would make sense. When mixing server-generated and client-supplied, numeric ids, one has to make sure the two use distinct ranges by manually setting the sequence to a value that doesn't conflict with the user-supplied range. Since this is very use-case specific, there is not much that FROST can do. I think this is mostly a documentation issue... |
Mmm, Yes, I'm afraid I have to agree about the mixing of id's :-) But what about giving back a little more info then a 500 in case of conflicting id's? Would that be an issue? |
No, that would be a good idea. If anything, it should be a 4xx, not a 5xx, and a clearer error message should also not be too hard to implement. |
Experimenting here with idGenerationMode=ServerAndClientGenerated, mostly to create a re-usable test framework (by using fixed id's).
I see that when you insert for example Thing one with id 1, and then repeat that, you only get back a 500 with:
'{"code":500,"type":"error","message":"Failed to store data."}'
back.While the server logs:
[insert into "THINGS" ("NAME", "DESCRIPTION", "ID") values (?, ?, ?) returning "THINGS"."ID"]; ERROR: duplicate key value violates unique constraint "THINGS_pkey" Detail: Key ("ID")=(1) already exists.
Is there a reason to not add (al least the last part:
Detail: Key ("ID")=(1) already exists
to the 500 message?Seeing: #499 this could be security thingie?
Trying to create a simple Python lib (for use in QGIS plugin) + terminal/CLI to create and search Entities here. And it is useful to present this to the user?
The text was updated successfully, but these errors were encountered: