Bump up op-sqlite version for react native v0.76#37
Conversation
|
Thanks for the PR! I will review it when I'm back working on my mobile app |
|
Looks like the Error.stack getter issue has been resolved here: facebook/hermes#1496 (comment) But not landed in RN yet? |
|
Patching function createError(error, reason) {
var err = new PouchError(error.status, error.name, error.message);
if (reason !== undefined) {
err.reason = reason;
}
return err;
} |
|
Created a PR: apache/pouchdb#9009 |
|
Sweet, thank you. Shall we wait for pouchdb to make changes, or should we patch it ourselves |
|
Let's wait for it to be merged. |
|
Sure, please proceed |
| doc = unstringifyDoc(item.data, metadata.id, item.rev) | ||
| doc = unstringifyDoc(item.data as string, metadata.id, item.rev as string) | ||
| finish(null) | ||
| }).catch(e => { |
There was a problem hiding this comment.
Can you revert this 'catching all errors' part?
There was a problem hiding this comment.
No, this catch is important, since it rejects the promise of async execution. If removed, pouchdb.get() will remain unresolved.
There was a problem hiding this comment.
You mean, it is for catching errors thrown from tx.execute?
There was a problem hiding this comment.
Yes, or tx.execute will hang
|
hmm, trying to run it locally but it seems that Pods are broken: will try generating a project with |
|
Have you tested replications? |
|
#37 (comment) I did not test replications, just local transactions. |
|
replications never finish. Maybe another breaking change in RN0.76 |
|
It could be another unresolved promise, i.e. an unhandled error in the promise, similar to the createError issue we encountered before. |
|
Yeah, I had to apply the patch to pouchdb-errors both in |
|
apache/pouchdb#9028 solved the error issue. |
#35
In React Native 0.76.3, createError from pouchdb-errors would throw an exception. To handle this, I catch all errors. However, this causes specific errors like MISSING_DOC to be converted into a more generic error:
Error.stack getter called with an invalid receiver.
You can see the related code here:
core.ts#L343