-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
[REQUIRED] Environment info
firebase-tools: all
Platform: all
[REQUIRED] Test case
In the export code for Firestore we delete all the existing export data before the new data is written:
firebase-tools/src/emulator/controller.ts
Line 782 in 0641bd2
| rimraf.sync(firestorePath); |
This can cause data loss if the export fails. It can also cause issues like #3487 where a clean shutdown puts the emulator in a bad state.
Instead we should:
- Export into a
tmpdirectory - If the export succeeds, overwrite the existing directory and delete the
tmpdata
[REQUIRED] Steps to reproduce
Hard to reproduce, but see above.
[REQUIRED] Expected behavior
Never lose data unless there is better data.
[REQUIRED] Actual behavior
See above.
jirizavadil