GithubHelp home page GithubHelp logo

Comments (8)

kripper avatar kripper commented on August 15, 2024

I tested Safari on IOS and got the same error.

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

I tested Safari on Windows and also get the same error.
I confirmed that sometimes replication works fine for the same databases that other times failed.
Besides, I saw another error I'm not sure if it is related:
ReferenceError: Can't find variable: WebKitBlobBuilder
This is probably triggered because we have some docs with blob attachements.

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

I found out that the error is occurring because of the blob attachments.
When I disable the replication of this particular DB containing blob attachments, everything works fine.
Any workaround to use blobs on IOS?

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

The exception that is thrown by new Blob(parts, properties) in createBlob() is:

"'[object BlobConstructor]' is not a constructor (evaluating 'new Blob(parts, properties)')"

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

:-(

Disabling the replication of the DB with the blob attachment fixed the problem on Safary for Windows (which was throwing the same error as on IOS)...but I'm still getting the error on PhoneGap for IOS and Safary for IOS.

So, we have two issues here:

  1. Replication of blobs are failing on Safary for Windows and Safary for IOS and PhoneGap for IOS. This causes "Database encountered an unknown error" for this and subsequent replications.
    When disabling the replication of the DB with blobs, replication works at least on Safary for Windows, but NOT on Safary for IOS and PhoneGap for IOS.

  2. Safary for IOS and PhoneGap for IOS causes "Database encountered an unknown error", even when not replicating blobs.

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

Turned out that the app was doing concurrent replication (pulls) of the same database. This was causing the error on Safari and IOS, but not on Android.
I would suggest to detect this situation on Pouch's side (even when it's the users fault, it will save anyone's time and avoid users reporting bugs caused by race conditions ).
To solve, I added a flag on the pouch database object to prevent replicating twice while another replication is going on for the same DB.
There are many other reported issues regarding the "Database encountered an unknown error" message which could be related to this problem.

from pouchdb-load.

kripper avatar kripper commented on August 15, 2024

BTW, blobs are still generating an error when they are pulled on Safaty for Windows, Safari for IOS and PhoneGap for IOS (works fine on Android and Chrome).
But they are pushed correctly on PhoneGap for IOS.

from pouchdb-load.

nolanlawson avatar nolanlawson commented on August 15, 2024

Hmm, I'm not really understanding what's going on here. Do you have a reproducible test case?

I do know that there's a bug in iOS Safari WebView due to file:// URLs. Maybe you're hitting that: #11

from pouchdb-load.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.