You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While #3103 now allows patching metadata in general, it is still not possible to patch metadata if the value is null. Since that is the value to which the metadata fields are set initially, there is no reliable way to atomically patch metadata public/admin.
This could be solved by:
applying a patch operation to an empty object if the metadata value is null
setting the default for the metadata columns to {} and adding a not-null constraint
Reproducing the bug
create an identity with metadata_admin set to null
PATCH /admin/identities/{id} with this request body:
This fails with the message replace operation does not apply: doc is missing path: /metadata_admin/shoe_size: missing value. The same happens with "add".
It's not yet actually fixed, only the root cause has been fixed.
The ory/x dependency needs to be updated to the latest version in Kratos for the fix to be active.
PR: #3304
Preflight checklist
Describe the bug
While #3103 now allows patching metadata in general, it is still not possible to patch metadata if the value is
null
. Since that is the value to which the metadata fields are set initially, there is no reliable way to atomically patch metadata public/admin.This could be solved by:
{}
and adding a not-null constraintReproducing the bug
metadata_admin
set tonull
PATCH /admin/identities/{id}
with this request body:This fails with the message
replace operation does not apply: doc is missing path: /metadata_admin/shoe_size: missing value
. The same happens with"add"
.On the other hand, this:
Will succeed the first time when the metadata value is
null
, but when the metadata field already has other fields, they will be removed.Relevant log output
No response
Relevant configuration
No response
Version
0.13.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
The issue was reported before in #3099. A related issue was reported in #2950 and fixed in #3103.
The text was updated successfully, but these errors were encountered: