dashkite / sansa

Other
0 stars 0 forks source link

State Update Handler Fires Before Disconnect Handler #37

Closed dyoder closed 1 month ago

dyoder commented 1 month ago

After re-rendering the editor pane, the prior editor's disconnect handler runs, unsubscribing from state changes. However, by that time, the update handler has already run. So the editor attempts to render, which results in exceptions because the editor is expecting state that no longer exists.

Ideally, we can figure out why the update fires first and prevent that. A possible work around is to check the type of the gadget it references or set the path of the gadget in the data properties. These would be good improvements regardless.

dyoder commented 1 month ago

For now, I simply added a test to make sure the gadget was found. If not, the flow terminates.