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

[Bug]: [Juce8] [Script] Adding a property in a register DynamicObject doesn't update the script side variable #1458

Open
1 task done
benkuper opened this issue Oct 24, 2024 · 0 comments

Comments

@benkuper
Copy link

Detailed steps on how to reproduce the bug

  • Create a DynamicObject A
  • set it a property "valueA" = 1
  • Create a script and use registerNativeObject to register object A
  • log objectA.valueA > result is 1
  • change valueA = 2 (without re-registering in the script)
  • log objectA.valueA > result is 2
  • create another dynamicObject B
  • set "object B" as a property of object A (without re-registering in the script)
  • log objectA.objectB > result is undefined
  • re-register objectA with registerNativeObject
  • log objectA.objectB > result is [Object] (good)
  • removeProperty objectB from objectA
  • log objectA.objectB > result is null

This means to me that non-object properties are synced between DynamicObject and scripts (recursively I think), so modifying and removing nested objects and values is working, but adding new properties doesn't update the script-side of the registered objects.

This becomes a problem having one structure tree that already takes some time to convert initially with JuceToQuickJS, but then when I add objects in that structure from the script, I need to manually call a refresh function that will force a reregister. Ideally, this would just be synchronised like the rest.

I can put up a minimal example if needed

What is the expected behaviour?

objectB is findable by the script as soon as "setProperty(objectB)" has been called on object A

Operating systems

Windows

What versions of the operating systems?

11

Architectures

64-bit

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
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