Skip to content

Workers KV update command with metadata does not update metadata #2664

@thomasgauvin

Description

@thomasgauvin

Confirm this is a Typescript library issue and not an underlying Cloudflare API issue

  • This is an issue with the Typescript library

Describe the bug

When trying to use the Write with optional metadata SDK command, the metadata is not saved.

I've created a minimal repro here: https://github.com/thomasgauvin/testing-workers-kv-sdk-typescript

To Reproduce

Clone https://github.com/thomasgauvin/testing-workers-kv-sdk-typescript
Update .env vars
Run npm run test:ts
Observe results

Code snippets

const result3 = await cf.kv.namespaces.values.update(
      NAMESPACE_ID,
      'ts-test-with-metadata',
      { 
        value: 'typescript-value-with-metadata',
        account_id: ACCOUNT_ID,
        metadata: { 
          contentType: 'text/plain',
          author: 'typescript-test',
          timestamp: new Date().toISOString()
        }
      }
    );


//The metadata is not saved

OS

macOs

Runtime version

5.9.2

Library version

4.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions