Enhance: restore version check to Mudlet XMLimport code#369
Enhance: restore version check to Mudlet XMLimport code#369SlySven wants to merge 3 commits intoMudlet:developmentfrom
Conversation
I foresee the need to tweak the Xml format in the future, however though there once was some checks for this in the code in the past it was commented out. This commit - which should go into both development and release_30 branches despite it not being technically a "BugFix" will now alert the user if they load any code which does not have a "version" attribute with a numeric value equivalent to 1.000f in the "MudletPackage" element of the Xml. It will not STOP the code being loaded, just issue the alert! This is to cover the CURRENT code against problems that might arise in the future if the XML format/structure gets changed which will otherwise go *undetected* by the Mudlet application as it is currently. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
The QtMath include is not available in Qt 5.0.2 so breaks compilation on that, pretty much the earliest version of the qt Libs we now support. Unfortunately this is the version that we are using for Linux platform Travis C.I. builds! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
I got the maths wrong...! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
This PR is likely to not merge cleanly with #372 as they touch common areas in the XML handling classes. I would suggest that this is held, possibly for rebasing until after that PR is merged. |
|
#372 is now merged, looks like this needs some conflicts resolved. |
|
I'm not sold on this. It means that any developers using a newer version of Mudlet will be spamming people who are using older versions of Mudlet even though they adjusted for it in the code. I don't see a good solution to that and I don't see this fixing a concrete problem were are having? |
|
This is a preventative measure! It is to prevent future versions of Mudlet silently messing things up in this version should some future archaeologist try using a later format file with something as ancient (to them) as the code at the point the check is put in (now, or hopefully soon). We have been using This does not stop the user attempting to load a too new profile save file but it at least gives the user warning that things are amiss, Cf. the version checking done for the map save file which has, admittedly mutated much more over time... Interestingly I was digging in the past recently to examine how the toolbar/menu/button code worked back in the era of Mudlet 1.0 - I was cautious and moved the contents of my present |
|
I understand it let's them load it, but like I said, any developer who makes a Mudlet package on Mudlet N+1 and makes sure it runs on Mudlet N fine will be spamming their users when they import the package because Mudlet N will say "this package was made on Mudlet N+1, watch out, might not work". People will know things are amiss when they don't work, I don't see this adding value. Being chatty is not good, people just want to play the game, not read warning messages. Am I misunderstanding? |
|
It should not be an issue because I do not anticipate that we will modify the XML format - in an incompatible way at all frequently - I do not expect to be in "new Mudlet version" ==> "new Profile XML format" cycle - I just want to cover ourselves should it become necessary. For instance our current way of storing variables in the XML format is rather inefficient (I'm currently maintaining a copy of a 8000-ish room map's room descriptions as a Lua table and it bloats my save files to over 10MB but with a redesign I knocked it down to 3.8MB) just by restructuring that part of the XML format better - but it was incompatible with the current format so it is just a prototype at present and may not make it out of my system... - if it ever did, the new Mudlet that supported it must have a way to produce the old format for a version (or more) to maintain backward compatibility but that does not help if there is no mechanism to cleanly TELL the user that there is a problem with the saved profile if they are using an older version. Despite past behaviour 😜 I do not want to spam people's console unnecessarily and I do not expect to cause the code here to be triggered any time soon but I would like it in place in Mudlet versions out in the wild for if/when we need it. |
|
I don't know if I can trust that, there are like 3+ map formats now - we
can't predict the future (I'd be a stock broker if I could).
Yeah but think about the user - what is a non-technical user supposed to do
when they see it?
…On Mon, Feb 27, 2017 at 9:02 PM Stephen Lyons ***@***.***> wrote:
It *should* not be an issue because I do not anticipate that we will
modify the XML format - in *an incompatible way* at all frequently - I do
not expect to be in a cycle of "new Mudlet version" ==> "new Profile XML
format" cycle - I just want to cover ourselves should it become necessary.
*For instance our current way of storing variables in the XML format is
rather inefficient (I'm currently maintaining a copy of a 8000-ish room
map's room descriptions as a Lua table and it bloats my save files to over
10MB but with a redesign I knocked it down to 3.8MB) just by restructuring
that part of the XML format better - but it was incompatible with the
current format so it is just a prototype at present and may not make it out
of my system...* - if it ever did, the new Mudlet that supported it must
have a way to produce the old format for a version (or more) to maintain
backward compatibility but that does not help if there is no mechanism to
cleanly TELL the user that there is a problem with the saved profile if
they are using an older version.
Despite past behaviour 😜 I do not want to spam people's console
unnecessarily and I do not expect to cause the code here to be triggered
any time soon but I would like it in place in Mudlet versions *out in the
wild* for if/when we need it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#369 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjMMppb5qeEAuQANcIooJoSN715onks5rgyvbgaJpZM4LkGT4>
.
|
|
Well what would they do otherwise when something doesn't work? 🤷♂️ This proposal, reporting the versions that the particular Mudlet Application version can handle and what it is seeing {the proposed code at the moment only gives the latter, so we could assume 1.000 for the former} gives a meaningful message to report; rather than the user having to give a general (and possibly version dependent) "it does not work" situation report - on the forum or anywhere else that help might be sought. Perhaps it is possible to reduce the size of the message - if that is felt to be over large? IMO It gives the user a meaningful "thing" to report if they are having a problem - and perhaps its absence in a problem situation can also improve on the overall user experience - if something is wrong I think most people would prefer even a semi-cryptic error message than just a general "not working right" response. |
|
I've worked with plenty of users who still say "it doesn't work" even
though there are detailed messages. In either case, to debug such issues
the errors console and Mudlet version in about dialog suffices - I don't
see this solving a problem in that area. I understand the need for
correctness - but that should be left in the code or for system
administrators. Error dialogs and warning messages for the casual user have
been silently done away with as they don't offer value in the general
scenario. That's different from debugging information of course, when you
get down to business you need to have it.
…On Mon, 27 Feb 2017 9:21 pm Stephen Lyons, ***@***.***> wrote:
Well what would they do otherwise when something doesn't work? 🤷♂️
This proposal, reporting the versions that the particular Mudlet
Application version can handle and what it is seeing {the proposed code at
the moment only gives the latter, so we could assume 1.000 for the former}
gives a meaningful message to report; rather than the user having to give a
general (and possibly version dependent) "it does not work" situation
report - on the forum or anywhere else that help might be sought.
Perhaps it is possible to reduce the size of the message - if that is felt
to be over large?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#369 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjKIMYOt_0Z8UQCrA_WkvfM8hn57dks5rgzBggaJpZM4LkGT4>
.
|
|
Will I have to add an option to turn this on (or even off 😕)? |
|
"if something is wrong I think most people would prefer even a semi-cryptic error message than just a general "not working right" response." How can you guarantee is something is wrong? It could be right. It could come from a newer Mudlet and still work fine. Sure, if you do an analysis on the code and you with 100% certainty know it will not work and something is wrong, I'm all for it. But this will have so many false positives that the warning messages will becomes useless and thus meaningless. |
|
@vadi2 I realise that we are about to put together and set 3.0.1 loose and that may be the next "long-term" version (depending on how long it takes to get 4.0.0 ready and whether any show-stopping changes happen in any MUD that we have traditionally worked with) I am still of the opinion that we should include a version check in the current code so that if we ever have to break the way we structure the XML data in the certain knowledge that it cannot be handled satisfactorily in a way by the current code then we have a clean way to stop it being used and to force the user to seek an updated version of Mudlet. I realise that it is a ☢️ nuclear option and not something to be used on a whim, but if the user uses an XML file which does carry a Two possible future developments that may require such shenanigans are:
it is cleaner, more compact and easier for both humans and a machine parser to read the meta-data as attributes rather than sub-elements: {I included an empty "key" sub-element in case there are other variable formats that need it but I am not sure it is needed} it might be feasible to go to the even more compact: or, for a non-empty value the more realisitc and as a recent test case with prototype code to do this I managed to shrink my current 10MB WoTMUD game save file down to under 4MB with just this revision but it is of course incompatible with the current format...}
tl;dr; Please can we have into the current code base ASAP: a version check introduced and parsing be aborted should the XML file being read contain a Bother, posted this initially into wrong PR commentary... |
|
Rendered obsolete - code has gone into release_30 branch which is to be merged into development... |
I foresee the need to tweak the Xml format in the future, however though
there once was some checks for this in the code in the past it was
commented out. This commit - which should go into both development and
release_30 branches despite it not being technically a "BugFix" will now
alert the user if they load any code which does not have a "version"
attribute with a numeric value equivalent to 1.000f in the "MudletPackage"
element of the Xml.
It will not STOP the code being loaded, just issue the alert!
This is to cover the CURRENT code against problems that might arise in the
future if the XML format/structure gets changed which will otherwise go
undetected by the Mudlet application as it is currently.
Signed-off-by: Stephen Lyons slysven@virginmedia.com