Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator does not restore firebaseStorageDownloadTokens on import #3414

Closed
harveylee opened this issue May 27, 2021 · 2 comments · Fixed by #3444
Closed

Emulator does not restore firebaseStorageDownloadTokens on import #3414

harveylee opened this issue May 27, 2021 · 2 comments · Fixed by #3444

Comments

@harveylee
Copy link

harveylee commented May 27, 2021

[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.

@samtstern
Copy link
Contributor

@harveylee thanks for the clear bug report!

@xSAVIKx
Copy link

xSAVIKx commented Jun 4, 2021

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants