firebase / firebase/firebase-js-sdk

Analytics Logs Run with High Priority

Open
#2,634 1 comment 0 reactions 1 assignee Claimed by @Feiyang1 View on GitHub
api: analytics feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Browser version: Chrome 80
* Firebase SDK version: ^7.6.1-0
* Firebase Product: hosting, functions, analytics

### [REQUIRED] Describe the problem
When using `logEvent`, the event logging requests run with `high` priority. Therefore, when I want to make an HTTP request, and also log the user event at the same time, I get this network stack, where my intentional HTTP request has a "waiting" time, probably caused because another `high` priority requests happen at the same time.
![image](https://user-images.githubusercontent.com/5757359/74524009-ea829780-4f26-11ea-8d4f-4f2d62e95237.png)

This is NOT the case with Google Analytics.

#### Steps to reproduce:

```javascript
logEvent("an event");
setTimeout(() => fetch("my-api-url"), 0); // This happens in the next event loop
```

#### Fix:

Pull request #2635

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.