I'm doing around 100 writes to Firestore offline. But after connecting to the internet I see some of my data is missing in the cloud. There are no errors in the writing process though. If I do the same thing online, all the data is synced to the cloud.
Below is the code I'm trying in offline mode. Each function has around 10 iterates. There are 10 functions running one after the other.
const updateCities = async (cities) => {
for (const city of cities) {
try {
const firebaseCity = await firestore().collection('cities').doc(city.id).get();
await firebaseCity.update(city);
} catch (error) {
console.log(error);
}
}
}
const updateUsers = async (users) => {
for (const user of users) {
try {
const firebaseUser = await firestore().collection('users').doc(user.id).get();
await firebaseUser.update(user);
} catch (error) {
console.log(error);
}
}
}
Are there any limitations in the firebase functionalities or I'm doing something wrong?