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
Crash on adding word goal in outline #561
Comments
Try disabling auto-saving. I suspect that feature is the culprit of most of the crash bugs while editing things on the outline screen. |
@DarkRedman what version of Manusrkipt are you using, and on which operating system? Manuskript renamed the Redaction pane to Editor since at least version 0.5.0. |
Sorry that I didn't replied that fast. |
After much testing and investigation I finally reproduced this crash. Steps to Reproduce:
I am working on a patch to address this crash. |
Continuing the investigation from the above post I searched for the error and found: Stackoverflow.com: “Unorderable types: int() < str()” Fix Attempt 1This led me to try the following code change:
To test I started manuskript, loaded recent project "issue561.msk", cleared the goal in outline on lower portion of window, and stopped manuskript. Then I started manuskript, loaded recent project "issue561.msk". Selected the Outline pane and double-clicked the Goal, typed in "333", pressed Enter and Manuskript crashed with the following console log:
Searching the Internet for this new problem I came across the following post: Stackoverflow.com: How to make “int” parse blank strings? Fix Attempt 2Based on the advice of the above link I discovered that Manuskript already had a toInt() function and led me to try the following code change:
To test I started manuskript, loaded recent project "issue561.msk", cleared the goal in outline on lower portion of window, and stopped manuskript. Then I started manuskript, loaded recent project "issue561.msk". Selected the Outline pane and double-clicked the Goal, typed in "333", pressed Enter and Manuskript crashed with the following console log:
Fix Attempt 3In an attempt to fix this latest problem I made this additional code change:
To test I started manuskript, loaded recent project "issue561.msk", cleared the goal in outline on lower portion of window, and stopped manuskript. Then I started manuskript, loaded recent project "issue561.msk". Selected the Outline pane and double-clicked the Goal, typed in "333", pressed Enter and wow! No crash! Success?I will perform more tests on this potential solution to see if any other issues crop up. |
See issue olivierkes#561 The problem appears to be a due to a combination of factors, such as: - Python does not automatically convert an empty/blank variable to the integer zero (0) - Default goal value is empty/blank for a new Text (scene) - Asynchronous events can occur such that the change in the Outline pane of a new Text (scene) goal from empty/blank to a value is not saved to the data model prior to the update event in the Editor pane accessing the model value for the word count progress display. Steps to Reproduce: 1. Start manuskript and create new project (no template). 2. Select **Outline** pane. 3. Click "Text Plus" icon to create a text (default name "New") 4. Select **Editor** pane. 5. Click on **New** to display empty text. 6. Select **Outline** pane. 7. Double-click the empty area on **New** line under title **Goal**, type in "300", and press **Enter**. Note that manuskript crashes with a segmentation fault. Work around the crash by using the already existing manuskript function toInt() which handles conversion of empty/blank values to integer value zero (0).
See issue olivierkes#561. The problem appears to be a due to a combination of factors, such as: - Python does not automatically convert an empty/blank variable to the integer zero (0) - Default goal value is empty/blank for a new Text (scene) - Asynchronous events can occur such that the change in the Outline pane of a new Text (scene) goal from empty/blank to a value is not saved to the data model prior to the update event in the Editor pane accessing the model value for the word count progress display. Steps to Reproduce: 1. Start manuskript and create new project (no template). 2. Select **Outline** pane. 3. Click "Text Plus" icon to create a text (default name "New") 4. Select **Editor** pane. 5. Click on **New** to display empty text. 6. Select **Outline** pane. 7. Double-click the empty area on **New** line under title **Goal**, type in "300", and press **Enter**. Note that manuskript crashes with a segmentation fault. Work around the crash by using the already existing manuskript function toInt() which handles conversion of empty/blank values to integer value zero (0).
See issue olivierkes#561. The problem appears to be a due to a combination of factors, such as: - Python does not automatically convert an empty/blank variable to the integer zero (0) - Default goal value is empty/blank for a new Text (scene) - Asynchronous events can occur such that the change in the Outline pane of a new Text (scene) goal from empty/blank to a value is not saved to the data model prior to the update event in the Editor pane accessing the model value for the word count progress display. Steps to Reproduce: 1. Start manuskript and create new project (no template). 2. Select **Outline** pane. 3. Click "Text Plus" icon to create a text (default name "New") 4. Select **Editor** pane. 5. Click on **New** to display empty text. 6. Select **Outline** pane. 7. Double-click the empty area on **New** line under title **Goal**, type in "300", and press **Enter**. Note that manuskript crashes with a segmentation fault. Work around the crash by using the already existing manuskript function toInt() which handles conversion of empty/blank values to integer value zero (0).
See issue #561. The problem appears to be a due to a combination of factors, such as: - Python does not automatically convert an empty/blank variable to the integer zero (0) - Default goal value is empty/blank for a new Text (scene) - Asynchronous events can occur such that the change in the Outline pane of a new Text (scene) goal from empty/blank to a value is not saved to the data model prior to the update event in the Editor pane accessing the model value for the word count progress display. Steps to Reproduce: 1. Start manuskript and create new project (no template). 2. Select **Outline** pane. 3. Click "Text Plus" icon to create a text (default name "New") 4. Select **Editor** pane. 5. Click on **New** to display empty text. 6. Select **Outline** pane. 7. Double-click the empty area on **New** line under title **Goal**, type in "300", and press **Enter**. Note that manuskript crashes with a segmentation fault. Work around the crash by using the already existing manuskript function toInt() which handles conversion of empty/blank values to integer value zero (0).
Closing this issue as PR #609 has been merged with the develop branch. |
A previous fix (5f9ea3) inadvertently broke the progress bar by converting to the wrong data type. (See issue olivierkes#561 / PR olivierkes#609). While checking the code I realized the problem occurred primarily because we weren't checking the validity of the values closer to the source. Doing so alleviates the need to check elsewhere. In the hope of inspiring a more systematic approach, a new uiParse() utility function has been added to curb the further growth of toXxx() functions that exist solely to validate user input. There is no doubt room for improvement, both on the end of the new uiParse() function as well as the spot where it is used. Ideally, the data that comes out of the model should already be 'safe', but since this is a bugfix for a bugfix I want to keep waves to a minimum. This commit fixes issue olivierkes#652.
A previous fix (5f9ea3) inadvertently broke the progress bar by converting to the wrong data type. (See issue #561 / PR #609). While checking the code I realized the problem occurred primarily because we weren't checking the validity of the values closer to the source. Doing so alleviates the need to check elsewhere. In the hope of inspiring a more systematic approach, a new uiParse() utility function has been added to curb the further growth of toXxx() functions that exist solely to validate user input. There is no doubt room for improvement, both on the end of the new uiParse() function as well as the spot where it is used. Ideally, the data that comes out of the model should already be 'safe', but since this is a bugfix for a bugfix I want to keep waves to a minimum. This commit fixes issue #652.
Each time I'm on the plan tab and edit the goal of one of the act and press enter to valid, Manuskript crash, but alternatively, when I'm on redaction mode and edit the goal on the sidebar and press enter, it doesn't crash.
The text was updated successfully, but these errors were encountered: