pouchdb-community / pouchdb-load

Load documents into CouchDB/PouchDB from a dumpfile
Apache License 2.0
120 stars 33 forks source link

Using proxy option in offline mode results in error #54

Open krisztian-am opened 7 years ago

krisztian-am commented 7 years ago

When I'm using the proxy option in an Ionic application with db.load, there's an uncaught error if the device is not connected to the internet. If I remove the proxy line everything works fine. Any ideas?

nolanlawson commented 7 years ago

Hm, the proxy needs a connection to the internet in order to generate a unique ID for the source and the target.

This is a nasty bug. You may just need to .catch() the error and retry using a timeout.

nolanlawson commented 7 years ago

Arguably the .load() method itself could do this sort of retry logic, but then it would need to implement backoff, etc. This is a really hard problem to solve.