klembot / twinejs

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

Harlowe overriding bundled SugarCube v2 #612

Closed tmedwards closed 5 years ago

tmedwards commented 5 years ago

Various versions of Harlowe override the bundled SugarCube v2 in Twine 2 version 2.3.4 (Window 10 executable release).

First noticed in the What has replaced the StoryCaption passage in Sugarcube 2.1.0? thread on intfiction.org.

You can see this behavior by using the Formats item in the library sidebar or the Change Story Format item from a story map's menu.

In the thread linked above, the bundled SugarCube v2 was replaced with Harlowe v2.1.0, while in my tests it's being replaced with Harlowe v3.1.0. In both cases, the story format entry is still labeled SugarCube, but the version info and description clearly show that it is a version of Harlowe. Attempting to compile also results in Harlowe.

The thread linked above includes a screenshot. Here's a screenshot from my test: image

klembot commented 5 years ago

Repro'd it on a fresh Mac install. Weirdly. the web version doesn't seem to have this problem.

klembot commented 5 years ago

I think what is going on in the Electron version is that it is sometimes trying to load multiple formats at once, particularly at startup, and there is a race condition because they both are making a function call to window.storyFormat(). This is only happening in Electron, I think, because it saves stories in published form. Thinking the best way to fix this is by forcing a one-a-time load in Vuex.