Skip to content

Emulator does not restore firebaseStorageDownloadTokens on import #3414

Closed

Description

@harveylee

[REQUIRED] Environment info

firebase-tools: 9.12.0

Platform: Windows 10

[REQUIRED] Test case

import { getStorage, useStorageEmulator, ref, getDownloadURL } from '@firebase/storage'

const storage = getStorage()
useStorageEmulator(storage, '127.0.0.1', 9199)

async function getMyFile () {
  const reference = ref(storage, 'myfile')
  return await getDownloadURL(reference)
}

[REQUIRED] Steps to reproduce

  1. Run the emulators (including storage): firebase emulators:start --import data --export-on-exit
  2. Upload a test file myfile to Storage using the Emulator UI
  3. Call the getMyFile() function from Javascript - works as expected, can fetch the file
  4. Ctrl+C to shut down the emulator. myfile is exported to data/
  5. Note that data/storage_export/metadata/<bucket>/myfile.json doesn't contain anything in customMetadata or downloadTokens properties? (This seems unexpected)
  6. Start the emulators again: firebase emulators:start --import data --export-on-exit
  7. Call the getMyFile() function from Javascript - receive error:
    FirebaseError: Firebase Storage: The given file does not have any download URLs. (storage/no-download-url)

[REQUIRED] Expected behavior

Download tokens are exported and imported between emulator runs.

[REQUIRED] Actual behavior

Download tokens are not exported/imported by the storage emulator.

Activity

  1. samtstern commented on May 27, 2021

    @samtstern
    Contributor

    @harveylee thanks for the clear bug report!

  2. xSAVIKx commented on Jun 4, 2021

    @xSAVIKx

    This is a showstopper for us to use the emulator in tests. It'd be great if #3444 can be merged and released sooner.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions