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

Invalid Session ID #17

Open
veris-amoghbanta opened this issue Apr 23, 2018 · 9 comments
Open

Invalid Session ID #17

veris-amoghbanta opened this issue Apr 23, 2018 · 9 comments

Comments

@veris-amoghbanta
Copy link

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?

@billmalarky
Copy link
Owner

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).

@veris-amoghbanta
Copy link
Author

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?

@veris-amoghbanta
Copy link
Author

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.

@billmalarky
Copy link
Owner

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?

@colaskirschoff
Copy link

colaskirschoff commented Jun 13, 2018

@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:
image

It seems that he lib fails when querying the jobs in getConcurrentJobs, and when debugging I got this weird issue:
image
Realm was querying my objects instead of the Job objetcs.

When doing the same query a second time it actually worked fine:
image

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.

@billmalarky
Copy link
Owner

@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.

email-bounce

@colaskirschoff
Copy link

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 :)

@billmalarky
Copy link
Owner

billmalarky commented Jun 14, 2018 via email

@colaskirschoff
Copy link

Yes I've gone through many issues around this and it seems that it won't be fixed soon.
Thanks anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants