firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.74k stars 868 forks source link

FIrebase Storage Offline is possible according to Gemini #8194

Closed davie-robertson closed 3 weeks ago

davie-robertson commented 3 weeks ago

Operating System

All - browser based issue

Browser Version

All

Firebase SDK Version

10.8.1

Firebase SDK Product:

Storage

Describe your project's tooling

Typescript, Lit, Vite - but not relevant for this issue

Describe the problem

I would like to cache some files (mostly translations and look-up in different languages) from Firebase Storage. I see Gemini is now provide 'advice and support' from within the Firebase Console.

I asked "can firebase storge be accessed offline?"

and the answer was:

Yes, Firebase Storage can be accessed offline. The Firebase Storage SDK provides offline support, which allows you to read and write data to and from the storage bucket even when the device is not connected to the internet.

To enable offline support, you need to call the enable() method on the Firebase.storage() object. This will create a local cache of the data in the storage bucket, which can be accessed even when the device is offline.

Once offline support is enabled, you can read and write data to and from the storage bucket using the same methods that you would use when the device is online. However, there are some limitations to what you can do offline. For example, you cannot create or delete files or directories, and you cannot modify the metadata of files.

When the device regains its internet connection, the local cache will be synchronized with the storage bucket. Any changes that you made to the data while the device was offline will be uploaded to the storage bucket, and any changes that were made to the data in the storage bucket while the device was offline will be downloaded to the device.

Offline support is a valuable feature for applications that need to access data from the storage bucket even when the device is not connected to the internet. It can help to improve the user experience and make your application more reliable.

I cannot find any documentation on this, and the .enable()method doesn't seem to exist.

Am I missing something obvious?

Steps and code to reproduce issue

try and find the .enable() method on firebase storage

jbalidiong commented 3 weeks ago

Hi @davie-robertson, thanks for bringing this to our attention. This is misleading, currently, Firebase Storage itself doesn’t support offline capabilities. However, there is an existing feature request.

That said, I've filed an internal bug for Gemini b/336476219 regarding the incorrect response. I'll go ahead and close this issue now. If you encounter another issue, feel free to create a new one.