PouchDB iOS replication failing for documents with inline attachments

I have a cordova web app that is using PouchDB. The first time a user logs in we execute a single shot replication to pull down all documents from the remote CouchDB. This works fine when running the app locally in browsers or when deployed as a native app on Android devices. However, on iOS the app always fails with an “Unknown Database Error”.

The problem seems to occur with documents that have photos stored as inline attachments. When I turn on debugging in PouchDB I can see the replication always stalls on the same document and it’s one that has an attachment. If I delete the document, the replication succeeds.

// Code to create PouchDB:
service.db = new PouchDB(pouchDbName, { adapter: 'websql' });

// Code to replicate:

Source: ios

1 Comment

  1. Nolan Lawson

    You may need to use the SQLite Plugin so that you can have more space. Although I’m surprised you didn’t see a popup asking to allow the app to store more space.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.