I have a custom database connection where the existing attributes in the user’s app_metadata are deleted unexpectedly after a user profile update operation.
The user had property A set as part of app_metadata and after a user update (PATCH) was performed to add a new property B to the app_metadata, the update did not include any mention of property A in the request body. This property disappeared from the user metadata.
We have a feature flag controlling the updates to the app_metadata field. Customers with this flag enabled should not experience this issue for users created after this flag is enabled. Please create a Support ticket if you want to enable this feature for your environment.
As a workaround, we suggest passing the full list of app_metadata properties in the update operation so that the data overwrites and appends those properties. This way, we can guarantee that all the attributes are not missing from the user’s app_metadata.
Please note that this issue only happens the first time we update the user app_metadata. In other words, after the first update, the subsequent updates will not exhibit this issue.
Also, you may want to consider updating all users once to avoid this from happening again.