SQLite storage fails while querying
Recently we've tried to run our app with the SQLite RxStorage and found an issue when doing a certain query.
The error we are getting is:
While debugging, I've found this to be an issue of this function:
In particular the isPlainObject check is causing the error:
function isPlainObject(e) {
return "object" == typeof e && e.constructor == Object;
}
The problem here is that if you pass null to this function the e.constructor == Object comparison will fail because typeof null is "object".
This should be fixed by changing the function to:
function isPlainObject(e) {
return !!e && "object" == typeof e && e.constructor == Object;
}
Can you add a test case for that? https://github.com/pubkey/rxdb-premium-issues
Here is the test case: https://github.com/pubkey/rxdb-premium-issues/pull/8
I know it might be hard to fix such bugs without test cases, but in this case I've detailed where and why I'm getting this error. I've also suggested a fix. - This is also not the first time I've filed a bug or PR for rxdb. I have limited capacity as well and since I'm a rxdb premium user I would also expect some initiative from your end and not just expect me to do "your job for you".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.
Thank you for providing the test. This is fixed and will be released in the next version.