- Platform: macOS, Windows, and iOS
- App Version: Latest
How to reproduce
Enter incorrect credentials or invalid URL for couchdb
Expected: Not say synced successfully and show error
Actual: Immediately says synced
I’ve been trying to get the sync server working for an hour. I can access the couchdb manually using curl, but for some reason the documents aren’t syncing. It would help if I can see the error in either the developer console or app, but there seems to be a bug where if the app thinks it synced successfully.
The only thing that is different is - I’m using a custom certificate authority for my host. The certificate authority is installed in my system’s root certs and other electron apps are able to validate the cert. That’s the only thing I can think of as to why it would fail, but still I think it should show an error to make it easier to debug
Thanks for the report.
That makes sense. Since the sync runs in the main process and not in a renderer process, you can’t see errors in the developer console.
Instead, you can run the app directly from a terminal with
--enable-logging option to see errors in the main process like so:
As to the sync status, since the sync fails for so many reasons like web proxy, unstable network, etc, it’s distracting to report every network error. So, it is by design.
Hope that helps.
Thanks for the response.
I get what you mean that it’s distracting to report every network error, but it’s also misleading to update the “last synced” timestamp if the sync failed. Assuming the sync process updates the store with the last synced timestamp, maybe a suggestion would be to also update it with an error flag if the sync failed, so the timestamp can be replaced with “failed to sync”. I understand if this isn’t a high priority though, since not a lot of people will use a custom couchdb instance.
I didn’t know about the enable logging option. I’ll use it the next time I get a chance to debug this.
The last synced timestamp indicates when the sync paused.
PouchDB doesn’t report errors when pausing the live sync.
It’s hard to properly handle every failure case.
Instead, I’ve added a section on how to debug the connection issues to the documentation: