After authenticating to a remote database, synching data to the local database should not report an error.
Current Behavior
I've copied some example authentication code and I can successfully authenticate using this module in a React Native application and dump the docs to the console. I would presume once I have a remoteDB connection, I should be able to sync data to the local database with the .sync() command. However when the following code block is present -
And the error changed a bit -
TypeError: undefined is not an object (evaluating 'src.once')
If I connect to a non-authenticated database, the sync works, so I'm thinking it is something with this module, I could be wrong, unfortunately I don't know enough about what is happening to debug this.
Steps to Reproduce (for bugs)
The following code will reproduce the issue
normal imports
import React, { Component } from "react";
import PouchDB from "pouchdb-react-native";
import PouchAuth from "pouchdb-authentication";
PouchDB.plugin(PouchAuth);
the function I call from my components constructor
This is a react native application for conference attendees. The application connects to my management server in order to update and display the current list of sessions, with changes populating down to the app. This really only needs a one-way sync, and never pushes data back to my server. Without the ability to sync local data, nothing is displayed in the app, because those UI components are using the local database.
Your Environment
Version of PouchDB Authentication: 1.1.3
Version of PouchDB: pouchdb-react-native - 6.4.1
Platform name and version: React Native - 0.55.4 / React Native cli - 2.0.1
Operating System and version: iOS
Server: CouchDB
Link to your project: I'm happy to push this to a repo if you need me to. I'll have to setup some CouchDB credentials for you to use in the app for testing, let me know if that would help.
Expected Behavior
After authenticating to a remote database, synching data to the local database should not report an error.
Current Behavior
I've copied some example authentication code and I can successfully authenticate using this module in a React Native application and dump the docs to the console. I would presume once I have a remoteDB connection, I should be able to sync data to the local database with the .sync() command. However when the following code block is present -
I receive - TypeError: undefined is not an object (evaluating 'target.once')
I mixed it up a bit and tried this format as well -
And the error changed a bit - TypeError: undefined is not an object (evaluating 'src.once')
If I connect to a non-authenticated database, the sync works, so I'm thinking it is something with this module, I could be wrong, unfortunately I don't know enough about what is happening to debug this.
Steps to Reproduce (for bugs)
The following code will reproduce the issue normal imports
the function I call from my components constructor
Context
This is a react native application for conference attendees. The application connects to my management server in order to update and display the current list of sessions, with changes populating down to the app. This really only needs a one-way sync, and never pushes data back to my server. Without the ability to sync local data, nothing is displayed in the app, because those UI components are using the local database.
Your Environment