angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.64k stars 2.2k forks source link

Performance traces are not being reported to firebase anymore #3282

Open misomarcell opened 1 year ago

misomarcell commented 1 year ago

Version info

Angular:14.2.4

Firebase:9.10.0

AngularFire:7.4.1

How to reproduce these conditions

...
imports: [
    provideFirebaseApp(() => initializeApp(environment.firebase)),
    providePerformance(() => (environment.production ? getPerformance() : undefined)),
]

Note that the environment is in fact production, I've verified it, so the getPerformance() should be evaluated.

Debug output

Screenshots image

Expected behavior

AngularFire Performance reporting performance data to Firebase.

Actual behavior

Not even network requests to firebaselogging.googleapis.com are happening. I've received data only between 11 and 20 of October. The relevant code did not change, so I have no clue why trace reporting stopped after the 20th.

misomarcell commented 1 year ago

Update

After a couple of days debugging this issue I figured, that performance reports only being sent, if the Performance class is injected at least once, for example in the constructor of the app.component.ts. Weirdly enough I didn't even have to use the the performance instance, it just has to be injected.

I believe it's a bug, since if I only need the traceUntilFirst operators in my app, there's no point injecting this class.

alethyst commented 1 year ago

@misomarcell I was having the same problem and injecting the performance class solved my issue, thanks.

Seems like a pretty major issue to have been reported more than 6 months ago and still not being solved.