react-native-queue
react-native-queue copied to clipboard
Invalid Session ID
It seems that only a single session of realm can be used at a time. So, If I try to open a new realm schema, it gives an error saying "Invalid Session ID". Does that mean that realm cannot be used in parallel with react-native-queue?
According to Realm js docs, it is perfectly acceptable to have multiple realms open at any given time. React Native Queue does not use the default realm, it uses a realm named "reactNativeQueue.realm".
What I'm thinking the issue could be, is perhaps your app's main realm package is a different version from the package that was installed as a dependency for react-native-queue.
What happens if you delete the react native queue realm dependency package in node_modules?
Also, you may have to "unlink" the react-native-queue realm dependency if you have already linked it via "react-native link realm" (but make sure you don't unlink your original installation of realm).
Seems to be a mismatch of realm versions. The version that react-native-queue installs is latest(2.3.4) which is unstable(doens't work with remote debugging on). So I fixed the version in this fork but on installing from the fork, node-modules are not downloaded inside react-native-realm node-module and react-native realm doesn't create "reactNativeQueue.realm". Is there any kind of build script you use before publishing it to npm?
Update: Deleting react-native-queue realm dependency package in node_modules does the trick, but that is more of a hack/work-around that needs to be done every time node modules are updated.
Deleting react-native-queue realm dependency package in node_modules does the trick, but that is more of a hack/work-around that needs to be done every time node modules are updated.
So if I update package.json to set the realm dependency version explicitly to "2.2.15" that will resolve the issue so long as the user rm's node_modules and then runs yarn again correct?
@billmalarky, yes, as soon as the user removes the node_modules as well as the yarn.lock ! And then a yarn install
and react-native link
should do the job.
Actually I decided to fork the repo as well with different versions of realm in the package.json. I tried 2.4.0, 2.2.20, 2.2.15, which always fixes the issue of "Invalid Session ID", but leads to another issue:
It seems that he lib fails when querying the jobs in getConcurrentJobs
, and when debugging I got this weird issue:
Realm was querying my objects instead of the Job objetcs.
When doing the same query a second time it actually worked fine:
If you have any idea on why it does that I'm willing to test a fix. If not I might need to rewrite this system of queue locally to avoid using a second realm instance. Or pass the realm instance as a parameter to the queueFactory.
@colaskirschoff hijacking this thread to let you know I have been trying to respond to you via email and my emails keep getting bounced off your mail server.
My response to you was:
It should work with 2.4.0.
If you are having issues a lot of times it helps to do a full rebuild of the project. Aka create a new directory, check out your code into the new cloned version of the repo and do all the install steps for react-native-queue/realm again.
Basically just do it all over again to make sure an install step didn't go wrong or upgrade went wrong.
See attached for error I'm getting.
Thanks for your answer @billmalarky ! I think the issue is actually a debugger issue. Everything's fine until I run the remote debugger. So it's more about realm versus react-native debugger than about your library :)
Realm has known remote debugger issues. Look around in the other githib issues in the react native queue repo and also maybe look at realms repo.
I haven't personally run into the issues with remote debugging myself but others have.
On Thu, Jun 14, 2018, 7:30 AM Colas Kerkhove [email protected] wrote:
Thanks for your answer @billmalarky https://github.com/billmalarky ! I think the issue is actually a debugger issue. Everything's fine until I run the remote debugger. So it's more about realm versus react-native debugger than about your library :)
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/billmalarky/react-native-queue/issues/17#issuecomment-397262521, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxTU23t5ZVcuE0XBQED4lRcml5iPXhyks5t8klSgaJpZM4Tfpzr .
Yes I've gone through many issues around this and it seems that it won't be fixed soon. Thanks anyway :)