Skip to content

Custom metadata broken in 0.12.0 #419

Description

@phw

Providing custom metadata via the metadata.metadata property as documented at https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.10.0/storage/file?method=setMetadata is not working for me with gcloud 0.12, but works fine with 0.11. Standard metadata works fine, too.

Partial sample code:

var metadata = {
  contentType: 'text/plain', // <- This works
  metadata: {
    customValue: 'MyValue' // <- This will not be set with gcloud 0.12
  }
};

inStream.pipe(file.createWriteStream(metadata));

Activity

  1. stephenplusplus commented on Mar 3, 2015

    @stephenplusplus
    Contributor

    Would you mind trying against master? I believe we realized this recently and it should be fixed for our next release.

  2. ryanseys commented on Apr 1, 2015

    @ryanseys
    Contributor

    Try the newest release! We just released v0.13.1 today.

  3. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: storageIssues related to the Cloud Storage API.
    on Apr 6, 2015
  4. stephenplusplus commented on Apr 6, 2015

    @stephenplusplus
    Contributor

    This will work:

    var options = {
      metadata: {
        contentType: 'text/plain',
        metadata: {
          customValue: 'MyValue'
        }
      }
    };
    
    inStream.pipe(file.createWriteStream(options));

    So, createWriteStream takes an options object. That object can hold a metadata object with file metadata, such as contentType. Inside of that, you can have another metadata object to hold custom values. It's a bit of a mind warp.

  5. phw commented on Apr 9, 2015

    @phw
    ContributorAuthor

    Sorry for my late response, I had this on my list but was unable to test it until now. I have now both upgraded to 1.13.2 and added the additional nesting in the options object, works as expected. Thanks for the fast reply and support.

  6. 19 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions