Print warning, if full version of app and model don't match #1280
Labels
good first issue
Good for newcomers
type: feature
New features and improvements to existing features
Currently, if the version of the Fornjot app doesn't match the version of Fornjot that a model uses, this will result in an error when the model is loaded. This works well enough for released versions, but the it might lead to confusion when in-development versions are involved. This might be the case, if a user tries to load an example model from this repository using a released version of the Fornjot app.
The version is determined at build time in the
fj
crate'sbuild.rs
. From there, it is included in thefj
crate, and thestatic
s defined there are then used at model-load-time infj-host
to check for a mismatch and potentially generate the error. Two different versions are determined and included infj
: The package version (something like1.2.3
), and a "full" version which includes more information, like the Git commit hash. Only the package version is used for the version check.It would be too restrictive to use the full version as the basis for the version mismatch check, but since a mismatch there might cause mysterious problems, it's probably best to print a warning, explaining the situation. I'm not sure what the ideal solution is, but for a start, it would probably be enough to log a warning-level log message to stderr.
Labeling https://github.com/hannobraun/Fornjot/labels/good%20first%20issue, as this only requires surface-level knowledge of Fornjot, and I've laid out all the moving parts here.
The text was updated successfully, but these errors were encountered: