-
Notifications
You must be signed in to change notification settings - Fork 32
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
NodeRed flow stops when callContext expires #10
Comments
+1 |
It depends where you are using finddata, for example, if you are using within an observer, the callcontext of the observer will take presedence. access token is not required for "find", right? If you can give specific issue with sample node-red flow that you are using, it will help. |
I am using find-data directly in flow, not in observer. Find basically searches on a model based on the filter provided to it, and on model we have ACLs applied (Specific Role have access), so in order to fetch data from such model, context should have access_token of the User who belong to correct Role. Flow example to search DefaultWorkGroup from Group Model:
Corresponding flow entries for it in NodeRedFlow collection:
If i remove the access_token (G8LQCyYgWCZaHKTQQLDo0x9ohiKDrvLmB7WM3OpMPrFr0m2cIgYe2hEykXwnZmOZ) from AuthSession collection or when it's ttl is expires, the flow doesn't output me the Group object and fails with Unexpected error 401. This seems correct as when we tries to search Model data from Swagger too, we need to set the access_token. But how a flow (containing similar find-data node) will keep working, which gets triggered when a message comes into a queue or an email received and access_token attached to flow nodes (when flow was deployed from node-red UI) is now expired. To make it work i need to keep deploying flow on the access_token expiry interval, isn't it? |
If i have a node red flow which uses some of the oe-cloud offerings like find-data node or a model observer node, it should have a valid callContext linked to each msg of the flow to execute successfully. Usually this callContext gets merged with the msg object at the time of Deploying the flow. However my question here is, what will happen when the access_token associated with the msg callContext expires?
I have observed that flow doesn't work, as it fails to do find-data in absence of valid access_token.
So in order to keep running my node red flow, i need to keep deploying it after sometime so that the valid access_token remains attached always. Isn't it an additional overhead? Or i am missing something here?
The text was updated successfully, but these errors were encountered: