Closed niklasfp closed 5 months ago
thanks @niklasfp. Found the issue. as you probably guessed it was the Headers which ought to be string,string[]
rather than string,string
.
@mtmk when this is fixed and released, it might break for people that only used the v2 client to add headers to objects. Not a problem for us, our problem is that the headers are in the correct format (not v2 compatible) 😉
yes it's going to be a breaking change unfortunately. as you said, if people have data (with headers) saved and used only with this client, data has to be migrated 😞
Observed behavior
After upgrading some object store code from .net v1 to .net v2 client we run into serialization bugs related to headers.
When trying to get information from a file stored (with headers) from nats cli or nats.net v1 the nats v2 client throws a json serialization exception (see exception below)
Also objects with headers added from the .nats v2 client cannot be read by nats cli:
And listing the same bucket hangs in the cli
Exception thrown
The problem is that .nats .net v2 just adds headers as dictionary, where other clients adds them as a dictionary with a string key and of array of string value.
Object meta from object added with nats cli:
Object meta from object added with nats v2 cli:
Expected behavior
Nats v2 client can read objects with metadata headers added from other clients. Nats v2 client can add objects with metadata headers compatible with other clients.
Server and client version
Server: 2.10.12 Cli: v0.1.4
Host environment
Windows 11 Nast server running in docker
Steps to reproduce
Create a bucket for testing
Add an object with headers
Run the following csharp code to verify that it breaks.
After running the csharp code, run the following cli command
will fail with
nats: error: nats: object-store meta information invalid