Resonite-Issues icon indicating copy to clipboard operation
Resonite-Issues copied to clipboard

Boolean input on FieldHook node to try linking the field instead of forcibly linking the field

Open yoshiyoshyosh opened this issue 6 months ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently, as is, the FieldHook node will forcibly link the field given to it using drive.ForceLink(), overriding any existing link unless the field being linked is itself linked and thus can't be changed by anything else.

This isn't always desirable. Sometimes, it might be useful to have a "lock" on a field that multiple potential drivers can try to acquire, but not want to take over if the field is already driven.

Describe the solution you'd like

A boolean input on the FieldHook node where, if true, the node will use TryLink() to attempt acquiring the link, but not actually get the link if the field is already linked.

Describe alternatives you've considered

A new node or property of drives itself. The former feels cluttered and I'm not sure how the latter would work.

Additional Context

No response

Requesters

grand, yosh

yoshiyoshyosh avatar May 27 '25 17:05 yoshiyoshyosh

This might need to be async so it can synchronize with any other racing attempts to hook the field from other clients…

bdunderscore avatar May 27 '25 19:05 bdunderscore

There's no need for it to be async - there's no "locking" mechanism. Most data model changes use optimistic concurrency. If another user changes it - then they will change it.

If you want a locking mechanism, that should be a separate request from this.

Frooxius avatar May 27 '25 20:05 Frooxius