willhlaw / node-firestore-backup-restore

Google Firebase Firestore backup and restore tool
91 stars 24 forks source link

Why is the backup operation calling restoreDocument? #41

Open Venryx opened 6 years ago

Venryx commented 6 years ago

I am running the backup command firestore-backup-restore --accountCredentials [...] --backupPath Backup1, yet while the backup is running, I keep seeing lines like this one: Restoring to collection /versions/v6-prod/tasks document FcJgIhpH6JgDoXMlepQUVLPfXmT2...

Looking at the source, it seems the restoreDocument function is called from here: https://github.com/willhlaw/node-firestore-backup-restore/blob/master/index.js#L242

Why is it "restoring" a document when it's just supposed to be doing a backup?

Are these interim "restores" actually setting data on the live database? If so, I'm concerned that a future bug in the library could cause backup operations to actually mess up data on the live database, when I would want it to only read from the database.

Saturnyn commented 5 years ago

I noticed the same problem. From the source, it looks like restoreDocument() will not do anything more than logging to the console if restoreAccountCredentialsPath is not set, but it is strange that the function is called at all. Anyone has more information on this ?