Loopback context is cleared on calling loopback-rest-connector methods
Description/Steps to reproduce
- Create custom datasource based on loopback-rest-connector
- Attach a model to this datasource
- Invoke upsert REST API
- Loopback context is null in afterRemote
Expected result
Loopback context should propagate fine.
Additional information
darwin x64 6.14.4 ├── [email protected] ├── [email protected] ├── [email protected] invalid ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] invalid ├── [email protected] ├── [email protected] ├── [email protected]
Notes
Also I tested loopback context using plain request and the context is null in request's callback in the below code snippet:
console.log('first:', LoopBackContext.getCurrentContext().get('someParam'));
console.log(arguments);
// test
request('http://www.google.com', (err, res, body) => {
console.log('second:', LoopBackContext.getCurrentContext().get('someParam'));
});
@josieusa Could you please have a look at this. It would be great if you can help with a quick workaround. Thanks in advance.
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 CODEOWNERS file at the top-level of this repository.