Meshroom icon indicating copy to clipboard operation
Meshroom copied to clipboard

Correctly catch syntax errors in node descriptions when reloading plugins

Open cbentejac opened this issue 3 weeks ago • 1 comments

Description

This PR fixes an issue that occurred during the reload of nodes that had syntax errors in their description. This caused an uncaught SyntaxError exception that was raised during the automatic parsing of the file in importlib.reload, before reaching the validation step for the description (which ensures all the attributes have been correctly written, with the expected types and so on).

On the UI side, this meant that the "Reload All Plugins" feature would stop without any notice as soon as a syntax error was encountered. This translated by the "Reloading plugins..." message being sent but never followed by another message.

With the changes in the PR, the SyntaxError exception is correctly caught, and the node status set accordingly. This does not interrupt the reloading process for all the nodes anymore, and if an error is encountered, an error message is sent with the list of all the nodes that were not successfully reloaded.

Nodes that are not reloaded because there has been no change in their description since the last time they were (re)loaded are not included in the error list.

A corresponding unit test is also added.

cbentejac avatar Dec 04 '25 11:12 cbentejac

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 80.87%. Comparing base (2c7223a) to head (b7c6bf2). :white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2947      +/-   ##
===========================================
+ Coverage    80.80%   80.87%   +0.06%     
===========================================
  Files           59       59              
  Lines         7842     7868      +26     
===========================================
+ Hits          6337     6363      +26     
  Misses        1505     1505              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 04 '25 11:12 codecov[bot]