-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object metadata does not update if a key is removed #1468
Comments
@KeithKeithDev thanks for reporting! This is definitely unexpected. |
@fsouza actually, I may have been making the wrong API call. To delete a key, you need to set a mapping to null for that key as per https://cloud.google.com/storage/docs/json_api#patch. So in reality, I should have called setMetadata with However, I see another potential issue.
It looks like the original metadata is wiped. https://cloud.google.com/storage/docs/json_api#patch. Can you reproduce this and confirm if it's an issue? |
@fsouza - also, another potential issue. When deleting a metadata item, it appears that the keys still exist, although the mapped value is "null". For example, if I call:
If I then call |
Hi, any updates on that? I'm experiencing the same issue here |
Using version: 1.47.6
I create an object with the initial custom metadata:
{foo=bar, baz=qux}
When trying to update the object's metadata with the following map (e.g. the 'foo' entry is now removed)
{baz=qux}
using the following code (as per the google gcs documentation here):
The following is logged and we can see that the
foo
entry is still there.Updated metadata Map(baz -> qux, foo -> bar)
However, if I update the object by changing the mapping of a single entry, so I update with:
{baz=blah}
Then I can see that the object's metadata is now updated to have just the 1 key and the
foo
mapping is gone, as expected:Updated metadata Map(baz -> blah)
Is this a bug?
The text was updated successfully, but these errors were encountered: