Skip to content
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

get function does not work in context scope #3

Open
romansoft opened this issue Nov 14, 2019 · 2 comments
Open

get function does not work in context scope #3

romansoft opened this issue Nov 14, 2019 · 2 comments

Comments

@romansoft
Copy link

When doing context.get, the returned value is undefined. Verified that context.set writes the value into Redis.
global and flow contexts work as expected.
I'm guessing something about keys is not matching between set and get in the context scope.

[{"id":"ff717bc4.01b6f8","type":"function","z":"b5b1f0dd.44fdb","name":"test Redis context write","func":"\n\ncontext.set("newPayload", msg.payload, "redis");\n\nreturn msg;\n","outputs":1,"noerr":0,"x":2190,"y":960,"wires":[["9e6ce691.4b1ae8"]]},{"id":"a7c4a692.06ef88","type":"inject","z":"b5b1f0dd.44fdb","name":"","topic":"","payload":"{"val1":123,"val2":234}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1940,"y":960,"wires":[["ff717bc4.01b6f8"]]},{"id":"9e6ce691.4b1ae8","type":"function","z":"b5b1f0dd.44fdb","name":"test Redis context read","func":"\n\ncontext.get("newPayload", "redis", function(err, newPayload) {\n if (err) {\n node.error(err, msg);\n } else {\n node.warn(newPayload);\n }\n});\n","outputs":1,"noerr":0,"x":2180,"y":1040,"wires":[["938f296c.c16e38"]]},{"id":"938f296c.c16e38","type":"debug","z":"b5b1f0dd.44fdb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":2390,"y":1040,"wires":[]}]

@knolleary
Copy link
Member

Hi - thanks for raising the issue. Please note you are raising an issue against code in a PR that has not been reviewed or tested by the project yet (which is long overdue admittedly), so there may be issues we don't know about yet.

I don't know if @HirokiUchikawa is available to look at this or if he has moved on to other things. If you are in any position to debug this, then adding any comments to the relevant bit of #1 would certainly be helpful.

@Tombcat
Copy link

Tombcat commented Dec 22, 2020

Are there any news about this issue? As far as i know the async function works and return values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants