Skip to content
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

Realm Result has no addListener method #729

Closed
dwsc opened this issue Dec 9, 2016 · 3 comments
Closed

Realm Result has no addListener method #729

dwsc opened this issue Dec 9, 2016 · 3 comments

Comments

@dwsc
Copy link

dwsc commented Dec 9, 2016

I'm using Realm 0.15.0 in React Native.

I'm trying to add a listener to a realm result per the documentation [1]. When trying the following:

realm.objects('Project').addListener((projects) => {...}
I receive:
_realm2.default.objects(...).addListener is not a function

Using the debugger, I can see that a "Results" object is returned with a "Collection" prototype.
Looking at the Results object methods available in the debugger, I do not see "addListener". It almost looks like the result object matches that of version 0.14.0, but I've verified that I'm using 0.15.0.

output of "head realm/packages.json"

{
"name": "realm",
"description": "Realm is a mobile database: an alternative to SQLite and key-value stores",
"version": "0.15.0",
"license": "Apache-2.0",
"homepage": "https://realm.io",
"keywords": [
"database",
"db",
"react",

I've also unlinked and relinked the realm module to ensure it's using the current version.

[1] https://realm.io/docs/react-native/latest/#notifications

Is there a reason that the addListener method would not be available?

@alazier
Copy link
Contributor

alazier commented Dec 10, 2016

This method is broken in chrome debugging but should work otherwise. There is a partial fix in version 0.15.1-rc which adds the method in chrome debug mode although it still does not yet work in call cases. We should hopefully have a full fix for this soon.

@mdekrey
Copy link

mdekrey commented Jan 10, 2019

This appears to have escalated in later versions of Realm: If I attempt to use Collection Notifications on Android with chrome debugging on as of 2.21.1, my application crashes with what looks like a android.os.DeadObjectException.

@kneth
Copy link
Contributor

kneth commented Feb 25, 2020

See `Realm.Results.addListener()

@kneth kneth closed this as completed Feb 25, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants