-
Notifications
You must be signed in to change notification settings - Fork 21
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
No context available when using express-session with Memory store #6
Comments
As loopback is not using getCurrentContext() anymore but is accessing the raw loopbackContext object, there is no check if the context is active or not. |
So apparently the |
The problem is caused by the memory store provided by express-session, which calls I agree loopback apps should not crash in such case, strongloop/loopback#2649 will fix that. However, fixing express-session is up to somebody else to do. |
Let me clarify this. When I changed |
@bajtos have you had a chance to try cls-hooked? I'm curious if it helps with some of these known cls issues. The latest cls-hooked version supports node 4.5.0. |
@Jeff-Lewis initially I was testing with cls-hooked enabled (see https://github.com/azatoth/loopback-sandbox) |
@Jeff-Lewis there is a pending pull request reworking loopback-context to use cls-hooked, see #2 |
|
Link to PR #11 |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
If using session and token middleware, trying to access the explorer crashes the server with a "Error: No context available. ns.run() or ns.bind() must be called first."
see also strongloop/loopback#2636 and https://github.com/azatoth/loopback-sandbox for a testcase (is also reproducible if using plain loopback-context 1.0.0 without the cls-hooked patch)
@bajtos
The text was updated successfully, but these errors were encountered: