fix: Merge extra on update instead of replacing#787
Conversation
gtema
left a comment
There was a problem hiding this comment.
The change on it's own is clean, there is however one critical issue: provider sends one value for update (which is also logged in traces), but drivers persist a different value. It also opens doors for situations that for 1 provider one drivers merges the data, while the second one misses it and overwrites the data. The same is valid across providers.
It must be responsibility of the provider to prepare the data, while the backend driver is only responsible for persistence.
| state: &ServiceState, | ||
| id: &'a str, | ||
| endpoint: EndpointUpdate, | ||
| mut endpoint: EndpointUpdate, |
There was a problem hiding this comment.
changing methods signatures should not be necessary. You already take the ownership of the structure so you can also mutate it (let mut update = endpoint; if let ....). This applies to all methods.
Fixes update operations so the extra JSON field is merged with the existing value instead of being fully replaced, matching Python Keystone behavior
Closes #777
Note: this contribution was developed with AI assistance.