-
Notifications
You must be signed in to change notification settings - Fork 2
When calling the DatabaseManager.getDatabase function, the iOS app crashes. #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We are trying it out. Will come back to you in a few days. |
Hi @iVanPan |
When using an iOS tablet with an Ionic plugin, after receiving a callback, fetching data via GetDocument causes the app to hang/crash consistently after 20 iterations. |
I tried running over 20 iterations of |
I went through the files provided earlier and here are some comments on replication: It’s good practice to remove change and document listeners when they’re no longer needed, as leaving them active can cause memory leaks, and unexpected behaviour—especially when components unmount or replication is restarted. Some example cases where you would need to remove listeners:
You can find the documentation here to remove the listeners: https://cbl-ionic.dev/DataSync/remote-sync-gateway some example replicator tests for reference: https://github.com/Couchbase-Ecosystem/cblite-js-tests/blob/main/cblite-tests/e2e/replicator-test.ts Example app which shows how to configure database, configure replicator and start replication: https://github.com/couchbase-examples/cap-cbl-travel/blob/main/src/services/database.service.ts You may want to consider using a Live Query if you expect the result to reflect real-time changes to the database (like inserts, updates, or deletes), especially during or after replication. Documentation for live queries: https://cbl-ionic.dev/Queries/live-queries Example app for live queries: https://github.com/couchbase-examples/cap-cbl-sample/blob/main/src/services/database.service.ts If the above don't solve the problem, please provide the logs and the workflow of the app. Example of logs enabling - https://github.com/couchbase-examples/cap-cbl-travel/blob/f53ef16f4195ddf1a7ddd679390445867b1e8127/src/services/database.service.ts#L133 |
In the submitted demo, we only used a single listener to monitor data changes in a Collection. Upon receiving a callback, we called GetDocument to retrieve the document content, with no additional code. After 10-20 invocations, GetDocument stops returning data in the callback. |
@gerow-x There have been some improvement in the latest cbl-ionic package. Please try it out and let us know if this issue still persists. |
@gerow-x Did you have chance to test out with latest v1.0 - let us know of issue persists? https://www.npmjs.com/package/cbl-ionic/v/1.0.0 |
Is there a data race issue with openDatabases?
The text was updated successfully, but these errors were encountered: