-
Notifications
You must be signed in to change notification settings - Fork 236
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
Losing context data #421
Comments
@raymondfeng @bajtos @loay @dhmlau Any solution to this yet? |
@pbalan I am afraid the link https://github.com/pbalan/component-reproduce-error.git returns 404 to me. Is your repository perhaps private? Could you please make it public or at least grant me and my colleagues read access? |
@bajtos Sorry for the late response. I resolved this issue as it was not related to loopback context but appeared prima-facie. However, I again stumbled on the same problem today. Am trying to get loopback context inside middleware. @matt-landers solution doesn't work for me on |
Previously, I had implemented a before delete and after delete operation hook through hookstate.
|
@pbalan sorry, I have no idea how to reproduce the problem you are experiencing, therefore I am not able to help you. However, I noticed a suspicious thing in your code example - you are treating Model.deleteById = (id, options, cb) => {
Model.updateAll({id: id}, {
deletedAt: new Date(),
deletedBy: options.accessToken.userId,
}, cb);
}; |
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. |
Description/Steps to reproduce
I wrote a loopback component and all my tests are working with memory db.
However, when I change datasource to mongodb, I do not see the context data in operation hook.
Link to reproduction sandbox
https://github.com/pbalan/component-reproduce-error.git
Master Branch: runs with memory connector. TEST PASS
test-mongo Branch: runs with mongodb connector. TEST FAIL
Error thrown in source
Expected result
TEST PASS
Additional information
node -e 'console.log(process.platform, process.arch, process.versions.node)': darwin x64 8.9.4
npm ls --prod --depth 0 | grep loopback [email protected]
The text was updated successfully, but these errors were encountered: