- Status changed to Needs review
almost 2 years ago 4:36am 1 March 2023 - ๐ท๐บRussia niklan Russia, Perm
Created tests as requested in #7. They show the problem, but they also show that setting read-only to those properties doesn't fix it.
Maybe my tests have mistakes, I'm newbie in testing, so someone need to review my test logic.
The last submitted patch, 16: drupal-3052962-16.patch, failed testing. View results โ
- ๐ท๐บRussia niklan Russia, Perm
I set this one to ยซneeds reviewยป because it's needed. It's not clear, does test missing something or read-only property has no effect at all.
OP is also mentioned:
When using JSON:API to retrieve, alter (e.g. changing the title) and save back a node that has a field of type comment field, if the application does not take care of "removing" that field before issuing the PATCH request, there's a risk that the update operation is denied because comments have been added/updated on this particular node.
It sounds that we also need a test case when a comment is added while the host entity is being edited via JSON:API: load host entity โ create a new comment related to this host entity โ PATCH host entity without changing anything.
I also have, though, that there is another problem that tests shows. The JSON:API returns exact values which were set for read-only properties after PATCH and POST request. I'm not tested this yet, but it sounds like the comment field on host is updated, but statistics will be updated only on a next host entity load from the database. It doesn't update on host entity changes/save.
- Status changed to Needs work
almost 2 years ago 3:27pm 7 March 2023 - ๐บ๐ธUnited States smustgrave
Not sure if this helps but something I learned very recently, working on https://git.drupalcode.org/project/drupal/-/merge_requests/3535, with jsonapi is that the PATCH and GET use the same route and permissions. So if you're treating them separate that could be an issue.