angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

storage.ref list and listAll returning no result

Open RezaRahmati opened this issue 2 years ago • 1 comments

Version info

Angular: 14.1.3

Firebase: 9.9.0 (same after upgrade to 9.9.3)

AngularFire: 7.4.1

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

Steps to set up and reproduce

  1. Inject AngularFireStorage to your angular component
  2. upload a file via AngularFireStorage to make sure angularfire is working
  3. call list or listAll, check the result, it's always empty
import { AngularFireStorage } from '@angular/fire/compat/storage';
       ...
	constructor(private storage: AngularFireStorage) {}
       ....
		const ref = this.storage.ref('');
		// ref.listAll()
		ref.list()
			.subscribe((data) => {
				console.log(data);
				data.items.forEach((element) => {
					console.log(element);
				});
			});

Sample data and security rules

Debug output

** Errors in the JavaScript console ** No Error ** Output from firebase.database().enableLogging(true); **

** Screenshots **

image

Expected behavior

Return list of files

Actual behavior

Return no item

RezaRahmati avatar Aug 25 '22 02:08 RezaRahmati

Update:

Seems issue is related to some bad folders. when I remove this folder I am able to get the files

image

RezaRahmati avatar Aug 25 '22 02:08 RezaRahmati