Description
Operating System
Pop OS
Environment (if applicable)
Angular, Chrome
Firebase SDK Version
9
Firebase SDK Product(s)
Performance
Project Tooling
I'm using Angular 19 with @angular/fire
Detailed Problem Description
I was attempting to use the Performance Monitoring feature, and from the start, it wouldn't send any of the events that are automatically tracked. It also wouldn't send any of my custom traces (I had one for testing when I realized the built in monitoring wasn't working).
Eventually, after a couple of days on StackOverflow and GitHub, researching the issue, I found the source code for this in my Chrome DevTools, found the spot where the request via navigator.sendBeacon and, if necessary, fetch, will post the events to the logging endpoint. Unfortunately, if an error is encountered, the catch block doesn't capture the error in a variable, so I wasn't sure what the error was.
Then I ran across another issue in another repository where the navigator.sendBeacon call was returning false, and one suggested that it might be because the request body is too large. Sure enough, I set a breakpoint on the call to the endpoint, and there was hundreds of events in the request body. So I removed all but one of them in the debugger, and let it roll. Events started streaming in finally.
I'm not sure how the events accumulated this much without any of them being sent to the logging endpoint, as this was my first few days trying to use the feature. But now events are streaming in. I'm not sure if this will happen again or what caused it, but I wanted to report this issue in hopes that handling the request body being too large might be something worth handling in the firebase sdk itself as I don't seem to see a way to get a hold of these events in my code.
Steps and code to reproduce issue
- Use Angular 19
- Use the app without Performance
- register Performance and make sure it is initialized
- somehow get hundreds of events to accumulate without them being sent, successfully, to the endpoint, beyond the point where the request body is too large for navigator.sendBeacon and fetch