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

interval and timer Javascript does cause circular reference error #128

Open
Subnum12 opened this issue Nov 25, 2024 · 1 comment
Open

interval and timer Javascript does cause circular reference error #128

Subnum12 opened this issue Nov 25, 2024 · 1 comment

Comments

@Subnum12
Copy link

The JavaScript translation for interval (for timer it's same behavior) causes this error.

grafik

I just added this interval and did send messages with true/false payload. After some seconds I get this error:

"Context 5349578a099cecbb:434ba4f022dce874 contains a circular reference that cannot be persisted"

I do get same error using function block with corresponding JavaScript.

if (context.get("interval_1")) {
  clearInterval(context.get("interval_1"));
}
var interval_1 = setInterval(function() {
}, 1000);
context.set("interval_1", interval_1);

That's how the JavaScript should look like not causing any error:

//does not need to be checked if exists.
clearInterval(context.interval_1);

var context.interval_1 = setInterval(function() {
}, 1000);

I do not know if this is relevant, but my context store (settings.js) is defined like this:

contextStorage: {
         default: {
             module:"localfilesystem"
         },
			memory: {
             module:"memory"
         }
     },		
@Subnum12
Copy link
Author

Feature request:

You maybe also add to Config node a setting to select the context store as noted here: https://nodered.org/docs/user-guide/context#using-context-in-a-flow

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

1 participant