klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Errors when adding a story format without a patch version #626

Open mcdemarco opened 4 years ago

mcdemarco commented 4 years ago

Describe the bug I decided to test out my test story format, Entest, with a fake version number, 2.0, which was higher than any version number in my long collection of previous tests of Entest. This new version updated all the others from various versions 1.x.y to v2.0 despite most of them having different names (Entest1, Entest2, etc., and also "Untitled Story Format") than the 2.0 story format (Entest18), and also despite this being a breaking version number change.

I was able to reproduce this with version 2.1 (not a breaking version number change, so not as bad, but just as pervasive), and then get a return to mostly normal behavior with version 2.1.1. (See second screenshot.)

Actually, after quitting and reopening, I saw the behavior was still affecting every instance of Entest. See third screenshot. Then after some cleanup I noticed I had duplicates of my last story format (fourth screenshot).

To Reproduce Steps to reproduce the behavior:

  1. Make a little story format.
  2. Edit it many times with different, but similar, names and 1.y.z version numbers, installing each one in desktop Twine using the file protocol.
  3. Do this a few times with the same name to test patch and minor version replacement.
  4. The final time, give it the version number 2.0 and install that one.
  5. Shut down Twine after some spinning and reopen.

Expected behavior Some nice error, or maybe the initial sign of failure, which was a spinning wheel in the install tab and a console error saying “Uncaught TypeError: Cannot read property ‘minor’ of null”

Screenshots semantic-unversioning

semantic-unversioning2 1 1

semantic-unversioning2 1 2

semantic-unversioning2 1 2dups

App version Twine 2.3.5, desktop, downloaded fresh today.

Environment

Additional context This accidentally reproduced a problem I noted in my initial semver testing but that I couldn't otherwise reproduce today: intermittent treatment of story formats with different names but the same contents as the same story format.

klembot commented 2 years ago

Labelling this a p4 bug. 2.4 uses semver which expects a patch version. It looks like it has a coerce function to try to fix this problem, which we could try using.