[Kst] Sort of serious bug...

D. V. Wiebe dvw at ketiltrout.net
Fri Mar 6 22:03:35 UTC 2015


On Wed, Mar 04, 2015 at 07:58:45PM -0500, Barth Netterfield wrote:
>    This changed the number of scalars that a vector has.
> 
>    This, in turn, breaks scalar lookup from all kst files created before that
>    commit.

I don't really understand the issue here, which might invalidate some of what
I say later.  Does kst assume there are a fixed number of scalars per
vector, say N, and then seek into the scalar array with some sort of
i*N+j?  Does adding more scalars per vector require renumbering the
scalars?

>    Which is super bad.
> 
>    The solution is not trivial, and reveals a fundamental fragility in the
>    shortName system combined with how we save and load objects.
> 
>    Options:

I'm not sure if this is one of the options listed but, if kst is to be
used in production environments, being backwards compatible when it comes to
reading old .kst files is necessary.

There needs to be better versioning of the .kst files.  Right now they
all seem to have version="2.0" at the top, which would be grand if that
number ever got updated.  You might want to add a separate version number
for the kst XML syntax (is this what people call a "DOM"?) which is
updated whenever that changes.  That would divorce it from the kst
package version.

Then you need to extend the parser to handle multiple versions of the
syntax and convert old versions to the current one.  If this requires
renaming or renumbering scalars when reading the .kst file, then do it.
If this is potentionally surprising to the user, make a pop-up dialog
box inform them that this is what's happening because the .kst file is
old, and maybe they should update it.

My recommendation is that all the logic for handling old .kst files be
in the .kst file parser itself, and the output of the parser present a
single, standardised object to the rest of kst, regardless of the age of
the .kst file.

I don't think you should write old versions of .kst files.  If a user
loads an old file and then saves it again, just convert it to the new
version.  The only benefit the user gets from writing old .kst files
is the ability to read them in old version of kst.

-dvw
-- 
Don Wiebe                                   dvw at phas.ubc.ca
Department of Physics and Astronomy
University of British Columbia              Hennings 204
6224 Agricultural Road                      Tele: +1-604-822-2585
University Endowment Lands, BC
Canada   V6T 1Z1                            http://ketiltrout.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kst/attachments/20150306/22b65ad8/attachment.sig>


More information about the Kst mailing list