You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a model, Fornjot checks the version of the fj crate that the model was compiled against, to compare it against the version of the Fornjot app. If there is a mismatch in the "package version" (for example, the version of the Fornjot app is 0.31.0, but the model uses fj version 0.30.0), this leads to an error that is displayed in the GUI.
On top of that, the app also checks the "full version", which includes the Git commit hash. This is useful, if either the app or the model use a development version instead of an official release. Since this is not necessarily a problem, and also not a case that most end users will have to deal with, this only results in a warning.
The problem is, this warning is only printed to stderr, which means the user might never see it. If that mismatch does cause a problem, this could be very confusing. Therefore, the warning should be shown in the GUI, maybe in addition to being printed to stderr.
The warning is printed in Model::evaluate, which is called by HostThread::process_model. HostThread already send events to the GUI via ModelEvent. To show this warning in the GUI, at least the following would have to be done:
Add a mechanism to tell HostThread::process_model about the warning. Maybe by adding a warning: Option<String> to Evaluation, which is the return value of Model::evaluate.
Add a variant to ModelEvent and send that in HostThread.
When loading a model, Fornjot checks the version of the
fj
crate that the model was compiled against, to compare it against the version of the Fornjot app. If there is a mismatch in the "package version" (for example, the version of the Fornjot app is 0.31.0, but the model usesfj
version 0.30.0), this leads to an error that is displayed in the GUI.On top of that, the app also checks the "full version", which includes the Git commit hash. This is useful, if either the app or the model use a development version instead of an official release. Since this is not necessarily a problem, and also not a case that most end users will have to deal with, this only results in a warning.
The problem is, this warning is only printed to stderr, which means the user might never see it. If that mismatch does cause a problem, this could be very confusing. Therefore, the warning should be shown in the GUI, maybe in addition to being printed to stderr.
The warning is printed in
Model::evaluate
, which is called byHostThread::process_model
.HostThread
already send events to the GUI viaModelEvent
. To show this warning in the GUI, at least the following would have to be done:HostThread::process_model
about the warning. Maybe by adding awarning: Option<String>
toEvaluation
, which is the return value ofModel::evaluate
.ModelEvent
and send that inHostThread
.ModelEvent
accordingly.I believe these steps should be relatively complete, which means the work that needs to be done is relatively limited in scope. Labeling https://github.com/hannobraun/Fornjot/labels/good%20first%20issue to reflect that.
The text was updated successfully, but these errors were encountered: