loopback-context icon indicating copy to clipboard operation
loopback-context copied to clipboard

Loopback context is cleared on calling loopback-rest-connector methods

Open vijay22sai opened this issue 7 years ago • 3 comments

Description/Steps to reproduce

  1. Create custom datasource based on loopback-rest-connector
  2. Attach a model to this datasource
  3. Invoke upsert REST API
  4. 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'));
      });

vijay22sai avatar Jul 05 '19 12:07 vijay22sai

@josieusa Could you please have a look at this. It would be great if you can help with a quick workaround. Thanks in advance.

vijay22sai avatar Jul 05 '19 12:07 vijay22sai

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.

stale[bot] avatar Feb 11 '20 03:02 stale[bot]

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.

stale[bot] avatar Feb 27 '20 05:02 stale[bot]