- Issue created by @wim leers
- ๐ณ๐ฑNetherlands balintbrews Amsterdam, NL
wim leers โ credited balintbrews โ .
- ๐ฎ๐ณIndia Akhil Babu Chengannur
akhil babu โ made their first commit to this issueโs fork.
- Merge request !621Issues/3504366: ApiConfigControllers::post() should detect a conflicting ID... โ (Merged) created by Akhil Babu
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Updated ApiConfigControllers::post() and added the tests. Please review
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Thanks for pushing this forward! ๐คฉ ๐
This is on the right track, but there are a few things that make this brittle and incomplete. See my review on the MR ๐
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Thanks @wimleers and @omkar, I have updated the PR to include both the js_componen and xb_asset_library entities. The same id error does not occur for pattern entities as
Drupal\experience_builder\Entity\Pattern::generateId()
updates the id if an entity with same id exists. - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
After @akhil babu's (great! ๐ โ thanks! ๐๐) work, 409 error responses started working, but they were using the same format as 500 responses (fatal server-side error), not the same as the much more similar 422 (validation error) responses.
That's bad, and @balintbrews already alluded to a similar problem in ๐ Add (validation) error handling to AddCodeComponentDialog and friends Active .
So let's do better. That was harder to explain than do, so I did it: https://git.drupalcode.org/project/experience_builder/-/merge_requests/6... (should pass, but GitLab CI is currently down)
But โฆ that commit makes it painfully clear how inconsistent (and hence convoluted) the current handling is. That change makes the minimal change possible to make 409 responses similar to 422, but look at the crazy logic I had to write for it! ๐คช
(This is nobody's fault: it grew organically. First we only had 500 errors, then we added an internal HTTP API that performed validation, so we added 422 responses for those. We decided to match JSON:API's error response structure for validation errors. Hence a mismatch was born.)
So โฆ did that in https://git.drupalcode.org/project/experience_builder/-/merge_requests/6....
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
The sole test failure here is the same random failure we saw on
0.x
overnight, as described in detail at #3499550-22: Support server-side massaging and validating of ComponentInputsForm values โ . The latest0.x
test run fails in a different random way.There's no point explicitly awaiting @longwave's review here IMHO, this is fine as-is. ๐ค
Also tightened
/openapi.yml
, both to have extra test assurances, and to let XB FE devs know what they should be able to expect. -
wim leers โ
committed ffb93219 on 0.x authored by
akhil babu โ
Issue #3504366 by wim leers, akhil babu, balintbrews:...
-
wim leers โ
committed ffb93219 on 0.x authored by
akhil babu โ
Automatically closed - issue fixed for 2 weeks with no activity.