KV Key metadata types too narrow
Between version 3.2.0 and 3.3.0 the type for KV's Key['metadata'] (and MetadataGetResponse) was changed from unknown to Record<string, unknown>.
This type is too narrow, as the metadata can be set to any valid JSON string. Since the value of the metadata is updated as a raw JSON string, this arbitrary nature is very useable. Presumably this is parsed by JSON.parse which respects this behavior. This can either be reverted to unknown, or widened to be a JSONValue type that is essentially most primitives.
This issue hasn't been updated in a while. If it's still reproducing, please comment to let us know. Thank you!
The associated code has still not been touched and still has this issue
I've raised an internal ticket with the KV team on this and asked them to weigh in. Thanks!
This issue hasn't been updated in a while. If it's still reproducing, please comment to let us know. Thank you!
This has not been addressed yet
Don't know why this closed. We are actively working on it with internal ticket KV-1525.
I have no idea why the automation was closing this down. @musa-cf any idea?
This is fixed by https://github.com/cloudflare/cloudflare-typescript/commit/cbdd3e82869bac6065a6b888457c10b7e8541f84#diff-c628bbbc70ea880984554871facce1db33196952aa18d29d3459fbde33088b7d
Will close with the next PR that merges release / next to main