GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Store only the value of a file in gcloud-node configstore file · Issue #693 · googleapis/google-cloud-node

Store only the value of a file in gcloud-node configstore file #693

New issue
Copy link
New issue
Copy link
Closed
Closed
Store only the value of a file in gcloud-node configstore file#693
Copy link
Assignees
stephenplusplus
Labels
api: storageIssues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@stephenplusplus
stephenplusplus
opened on Jun 26, 2015
Issue body actions

I'm not sure if this was a change in Node >v0.10 or something that was always sneaking under the radar, but the story goes...

We use a config .yml file that enables resumable uploads to work without the user having to understand what's going on under the hood. (Documented here).

It looks like we're having a potentially huge leak here: https://github.com/GoogleCloudPlatform/gcloud-node/blob/61ffa82c78cce44ed28b94d8a857c7c051cae9d0/lib/storage/file.js#L1394

var firstChunk = chunk.slice(0, 16);
// ...
configStore.set(that.name, {
  uri: reqOpts.uri,
  firstChunk: firstChunk
});

chunk is a Buffer. When you slice a buffer, it apparently keeps a property called parent, that is the entire original value of the buffer. As a result, we were writing the entire thing into a user's gcloud-node config file, when all we wanted was a measly 16kb.

Here's the fix:

var firstChunk = chunk.slice(0, 16).valueOf();

PR coming before today's release.

Activity

Next
  1. stephenplusplus
    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 Jun 26, 2015
  2. stephenplusplus
    changed the title [-]Store only the value of a file in temporary cache[/-] [+]Store only the value of a file in gcloud-node configstore file[/+] on Jun 26, 2015
  3. stephenplusplus
    closed this as completedin #694on Jun 26, 2015
  4. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  5. sofisl
    added 2 commits that reference this issue on Nov 11, 2022

    docs: fixed link from SentimentAnalysisResult feat: added filter for …

    4a80dba

    docs(samples): include metadata file, add exclusions for samples to h…

    7b4b928
  6. sofisl
    added 2 commits that reference this issue on Jan 10, 2023

    feat: new Bytes and File types: POWERPOINT and EXCEL (#693)

    30a95b6

    chore(main): release 3.4.0 (#694)

    216311d
  7. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    feat: export GRPC error code enum (#693)

    370ccc9
  8. GautamSharda
    added 2 commits that reference this issue on Jan 14, 2026

    chore(deps): update dependency js-green-licenses to v4 (#693)

    ab6e96a

    chore(deps): update dependency js-green-licenses to v4 (#693)

    d1b515f
  9. sofisl
    added 3 commits that reference this issue on Jan 27, 2026

    chore: add sync repo settings (#693)

    a7ec819

    chore: add sync repo settings (#693)

    dbfb730

    chore: add sync repo settings (#693)

    3caec59
  10. 3 remaining items

  11. GautamSharda
    added a commit that references this issue on Feb 2, 2026

    build: make ci testing conditional on engines field in package.json, …

    5d2c53c
  12. sofisl
    added a commit that references this issue on Feb 3, 2026

    build: do not fail builds on codecov errors (#528) (#693)

    dadb5a1
  13. GautamSharda
    added a commit that references this issue on Feb 3, 2026

    build: make ci testing conditional on engines field in package.json, …

    6839d76
  14. sofisl
    added 2 commits that reference this issue on Feb 4, 2026

    migrate code from googleapis/cloud-profiler-nodejs (#7087)

    288deb4

    fix: split insert, update, upsert (#693)

    a7268e5
  15. GautamSharda
    added a commit that references this issue on Feb 5, 2026

    chore(deps): update dependency js-green-licenses to v4 (#693)

    b3316ea
  16. sofisl
    added a commit that references this issue on Feb 17, 2026

    fix: split insert, update, upsert (#693)

    ffca601
  17. GautamSharda
    added a commit that references this issue on Feb 23, 2026

    chore(deps): update dependency js-green-licenses to v4 (#693)

    6d5d35a
  18. sofisl
    added a commit that references this issue on Feb 25, 2026

    fix(deps): update dependency @google-cloud/promisify to v1 (#693)

    9017031
  19. GautamSharda
    added a commit that references this issue on Feb 26, 2026

    chore(deps): update dependency js-green-licenses to v4 (#693)

    fda4d02
  20. GautamSharda
    added 3 commits that reference this issue on Mar 5, 2026

    fix(docs): writeLog should be in async function

    0ae7b51

    docs(subscription): fix broken links to pubsub methods (#693)

    390967a

    chore: relocate owl bot post processor (#693)

    91953e8
  21. sofisl
    added a commit that references this issue on Mar 17, 2026

    chore: update npmjs.org to npmjs.com (#693)

    bf735be
  22. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    fix(deps): update dependency @google-cloud/promisify to v1 (googleapi…

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: storageIssues related to the Cloud Storage API.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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.