Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sat plugin: migrating satelites.json dumps custom groups #4026

Open
2 tasks
axd1967 opened this issue Dec 26, 2024 · 2 comments
Open
2 tasks

sat plugin: migrating satelites.json dumps custom groups #4026

axd1967 opened this issue Dec 26, 2024 · 2 comments
Labels
importance: low Small problem, rarely visible, no crash opinion OP thinks something should behave differently subsystem: plugins The issue is related to plugins of planetarium...

Comments

@axd1967
Copy link
Contributor

axd1967 commented Dec 26, 2024

  • Whenever the version of the datafile is changed, the custom groups are lost.

image

image

Those groups should be preserved.

The pattern is to

  1. read the file format version
  2. import that file using that file version's importer (as it is likely that a recent file version reader might not be able to deal with older file versions; discarding the whole file is a simple yet brutal way to deal with this issue).
  3. migrate through later versions (e.g. using a fall-through switch <version> construct) that applies successive updates/transformations of the data
  4. save with the new file format version number

This is a design flaw that has never been dealt with. I suppose all modules that deal with JSON data need a utility to gracefully migrate older versions. I agree that this is no trivial task.

Workaround

Version the satellite datafiles, revert to the version that does contain the custom groups, then update the TLE via GUI. (Versioning should have been done prior to upgrading Stellarium...) I don't know whether this works for other JSON files too.

Additionally

  • is there an issue between here and here ? both seem to bear different version numbers. Also, it is odd that this version number is stored in three places, such as here.
@alex-w
Copy link
Member

alex-w commented Dec 26, 2024

The version of satellites.json file is not changes since version 0.12.0 of Satellites plugin. The field creator is not using to compare the versions of data. The version of plugin is not using to compare the versions of data.

@alex-w alex-w added importance: low Small problem, rarely visible, no crash subsystem: plugins The issue is related to plugins of planetarium... labels Dec 26, 2024
@alex-w
Copy link
Member

alex-w commented Dec 26, 2024

I've edited file and define custom group for 2 satellites at the moment, run Stellarium and call updating data for all satellites - custom group is not lost. I don't know what you doing to lost the data.

@alex-w alex-w added the opinion OP thinks something should behave differently label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
importance: low Small problem, rarely visible, no crash opinion OP thinks something should behave differently subsystem: plugins The issue is related to plugins of planetarium...
Development

No branches or pull requests

2 participants