Closed maierphilipp closed 1 month ago
➤ PM Bot commented:
Jira ticket: RJS-2827
@maierphilipp
Are you able to retrieve the subscription with realm.subscriptions.findByName("listSub")
? Moreover it is interesting if the subscriptions have been download by checking realm.subscriptions.state
.
Thanks for your Response! I can now access the initial-sub with .findByName("listSub"). This hasn't worked before.
{"internal": {"createdAt": {Symbol(Realm.Timestamp.external_pointer): [Object]}, "id": "6657f074b58fcbdade05afba", "name": "listSub", "objectClassName": "ShoppingList", "queryString": "TRUEPREDICATE", "updatedAt": {Symbol(Realm.Timestamp.external_pointer): [Object]}}}
gets logged to the console.
The State says "complete". I now encountered a new error. I am not able to subscribe to the query with the above code because .subscribe() is not a function but undefined. From where do I have to import it?
Sorry I really struggle with the subscriptions..
It's not clear to me how you've been able to create listSub
if you say .subscribe
is not a function? It sounds like at least once the code has run successfully in order to create the subscription. Can you create an isolated repro case for what you're seeing and share it here?
@nirinchev as mentioned above I subscribed to my ShoppingList as an initialSub. This is not the solution I was expecting, as I have multiple initial subs right now, but I didn't get the problem solved otherwise. ".subscribe() is not a function".
The commented-out code for initialSubscriptions
doesn't seem to assign a name, meaning it would create an unnamed subscription rather than one called listSub
. In any case, without a clear repro case, it's kind of hard to debug things over github. The subscribe
function is defined on Realm.Results - what is the type of list
when createSubscription
is invoked?
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
How frequently does the bug occur?
Always
Description
If I initialize a new named subscription using Expo SDK @50.0.17, Realm 12.8.1 and @realm/react: 0.6.1 the Subscription gets initialized and is working fine. But trying to access it by name is not possible. Loggin realm.subscriptions to the console leads to: {1: undefined, 2: undefined, ...}.
This my Provider:
And this is how the Query should perform on the ListScreen:
I don't know, if the issue occurs because of initializing this synced realm for the query wrong, but I have tried several, in the different Docs recommended, Ways and everyone leads to the same solution.
Thanks in advance.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
0.6.1
What services are you using?
Both Atlas Device Sync and Atlas App Services
Are you using encryption?
No
Platform OS and version(s)
Expo SDK @50.0.17, Realm 12.8.1 and @realm/react: 0.6.1
Build environment
Which debugger for React Native: ..
Cocoapods version
No response