Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

feat!: Align Support for Storage Emulation #2092

Open

Description

@danielbankhead

Today, baseUrl is equivalent to the STORAGE_EMULATOR_HOST, when available. This leads to limitations when using the client. Here's the relevant code snippet:

let apiEndpoint = 'https://storage.googleapis.com';
let customEndpoint = false;
// Note: EMULATOR_HOST is an experimental configuration variable. Use apiEndpoint instead.
const EMULATOR_HOST = process.env.STORAGE_EMULATOR_HOST;
if (typeof EMULATOR_HOST === 'string') {
apiEndpoint = Storage.sanitizeEndpoint(EMULATOR_HOST);
customEndpoint = true;
}
if (options.apiEndpoint) {
apiEndpoint = Storage.sanitizeEndpoint(options.apiEndpoint);
customEndpoint = true;
}
options = Object.assign({}, options, {apiEndpoint});
// Note: EMULATOR_HOST is an experimental configuration variable. Use apiEndpoint instead.
const baseUrl = EMULATOR_HOST || `${options.apiEndpoint}/storage/v1`;

Ideally, STORAGE_EMULATOR_HOST should only be a host (without any path associations, e.g. http://localhost:9199) while the client calls the appropriate path on the host (e.g. /storage/v1). That implementation should look something like this: c75b8b8

This requires coordination with Firebase and updates to Firebase Storage Emulator. Additionally, we should explore practices to ensure reliability and a consistent experience between Firebase and Google Cloud Storage (e.g. code consolidation and integration testing).

Related:

Background:

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    semver: majorHint for users that this is an API breaking change.
    priority: p3Desirable enhancement or fix. May not be included in next release.
    next major: breaking changethis is a change that we should wait to bundle into the next major version
    on Oct 21, 2022
  2. mgabeler-lee-6rs commented on Oct 21, 2022

    @mgabeler-lee-6rs
    Contributor

    The Go GCS client looks like it had some similar issues in the past. There's a fair bit in that repo if you search issues for STORAGE_EMULATOR_HOST, but this ticket is the closest to this and has two PRs linked to fix it: googleapis/google-cloud-go#2476

    The changes there look functionally equivalent to what I proposed in #2070, so I'm wondering if the firebase emulator may already have problems with the Go client? I have no experience with the firebase emulator, so I couldn't say for sure.

    A thought: as a stepping stone to avoid a "hard break", might it be useful to temporarily permit a second environment variable indicating how to interpret STORAGE_EMULATOR_HOST, with the initial default being the current behavior, and some specific value indicating to use the "new style", and at some point that default changes, and later that second env var is dropped?

  3. mgabeler-lee-6rs commented on Jan 3, 2023

    @mgabeler-lee-6rs
    Contributor

    Friendly check-in to see if there's any progress on decisions for how this might move forwards?

  4. danielbankhead commented on Jan 3, 2023

    @danielbankhead
    ContributorAuthor

    @mgabeler-lee-6rs hey, thanks for the inquiry; we plan to sync with peer teams on this and other issues over the next few months.

  5. mgabeler-lee-6rs commented on May 1, 2023

    @mgabeler-lee-6rs
    Contributor

    Just checking in on status and confirming that this is still of interest.

  6. danielbankhead commented on May 1, 2023

    @danielbankhead
    ContributorAuthor

    @mgabeler-lee-6rs We have alignment between teams and we're likely to resolve this in the current quarter.

  7. changed the title [-]feat: Align Support for Storage Emulation[/-] [+]feat!: Align Support for Storage Emulation[/+] on Jun 22, 2023
  8. mgabeler-lee-6rs commented on Aug 1, 2023

    @mgabeler-lee-6rs
    Contributor

    Obviously missed Q2, Q3 maybe? :)

  9. danielbankhead commented on Aug 7, 2023

    @danielbankhead
    ContributorAuthor

    @mgabeler-lee-6rs yea, I’m aiming for this half :)

  10. danielbankhead commented on Jan 29, 2024

    @danielbankhead
    ContributorAuthor

    Update: we had a few other high priority features to take care of; however we still have this as a key item to get to shortly.

  11. removed their assignment
    on Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking Changeapi: storageIssues related to the googleapis/nodejs-storage API.next major: breaking changethis is a change that we should wait to bundle into the next major versionpriority: p3Desirable enhancement or fix. May not be included in next release.semver: majorHint for users that this is an API breaking change.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions