Description
This came up as an unrelated bug discovered via #1787
This happens due to the two HandleWorkflowError
calls below:
bonsai/Bonsai.Editor/EditorForm.cs
Lines 1229 to 1241 in 88a2412
First the call on line 1231 invokes the main thread to display the error, then the exception is rethrown on line 1233. It's then caught a second time by the onError
handler on line 1241.
If I remember correctly, during a more typical exception the first call will show a dialog but the second one will only highlight the node and put the exception in the status bar.
This difference comes down to the status of building
in the first branch here:
bonsai/Bonsai.Editor/EditorForm.cs
Lines 1413 to 1418 in 88a2412
It is however worth noting that two dialogs will appear no matter what when the second branch is entered. (As with the original 1787 fix.) So even if this comes down to something related to building
there's still the potential for issues.
The handle call on line 1231 was added by 724b2e0 which was trying to fix a bug introduced by 9c8e390 for #908
We theorized that potentially this fix was actually trying to fix what was actually a race condition in reading building
by HandleWorkflowError
, but there's not enough context to say for sure. (See #1795)
We agreed it didn't make much sense to have two HandleWorkflowError
calls here, but because the issue supposedly fixed by 9c8e390 is pretty serious (two error dialogs is practically benign compared to completely silent errors), we don't want to risk a regression here by reverting that commit blindly and decided this issue warrants further investigation.
Activity