Open
Description
[REQUIRED] Describe your environment
- Operating System version: macOS 11.6
- Browser version: Firefox Developer Edition 97.0b9 (64-bit)
- Firebase SDK version: ^8.3.0
- Firebase Product: firestore
[REQUIRED] Describe the problem
We have an app where we are sending data to FIrestore every 15 seconds (on an interval). This works fine, when online. When offline the requests are queued, which is expected. If there are <=10 requests they are grouped together in one HTTP POST request. However, if there are more than 10 requests queued only the first 10 requests are grouped in one HTTP requests. The subsequent requests are fired one by one. This means if you've been offline for a while, and then go back online, a whole lot of HTTP requests are fired. I would expect that these would be grouped like the first 10, which would drastically reduce the number of HTTP requests to be sent. Is this something that can be configured? If not, why are not subsequent requests grouped?
Steps to reproduce:
- Put browser in offline mode
- Set interval for 15 seconds
- Send an update to Firestore in that interval
- Put browser in online mode
Relevant Code:
import firebase from 'firebase/app';
import 'firebase/firestore';
import firebaseConfig from './firebase-config.json';
const firebaseApp = firebase
.initializeApp(firebaseConfig);
const db = firebaseApp.firestore();
db.enablePersistence();
const document = db.doc('some/path');
setInterval(() => {
document.update({
content: JSON.stringify(subsession),
});
}, 15000);