peter88213 / nv_timeline

A Timeline converter plugin for novelibre.
GNU General Public License v3.0
1 stars 0 forks source link

Update Project doesn't work #1

Closed crzor closed 3 months ago

crzor commented 3 months ago

Update timeline works and the timeline file will have any changed values from the project.

The other way around doesn't. Whenever I update the project the values will stay the same.

In the Timeline app the changes are remembered, so only timeline -> project doesn't work.

peter88213 commented 3 months ago

Unfortunately, I cannot reproduce the error on my system. In order to help improving the nv_timeline plugin, please give me more information.

Can you provide a small reference project and timeline, where the synchronization does not work for you?

crzor commented 3 months ago

Thank you very much for the quick reply. I hope I'm doing it right:

Unfortunately, I cannot reproduce the error on my system. In order to help improving the nv_timeline plugin, please give me more information.

* Which version of novelibre, Timeline, and nv_timeline do you use?

All downloaded today. All plugins except _collection and _aeon2.

* Please make sure to save the timeline before trying to sync with novelibre. Since nv_timeline reads the .timeline file, unsaved changes may not be recognized. In case of doubt, close Timeline before syncing with novelibre.

Yes, I do that

* Do you see a success message (green status bar) in novelibre after updating the project from the timeline?

Empty green message.

* What data is not synchronized? Is it new events? is it just the date/time of an event that exists as a section in novelibre? Please be more specific.

Date and time of a pre-existing section in nv.

* Do you use a custom configuration?

No.

* Do you use unspecific dates (day instead of date) in your project? If so, did you set a reference date in the project?

No, I specify the date, time and duration.

Can you provide a small reference project and timeline, where the synchronization does not work for you?

Attached referenzprojekt.zip

peter88213 commented 3 months ago

Thank you for the test data. With this, I can now reproduce the error. It does look like a regression that is new with version 4. However, it needs further investigation, since the error did not occur during testing here. Did you also use the previous version 3.x?

peter88213 commented 3 months ago

Internal bug analysis

Why did this bug escape the v4.1.1 regression tests? When the SectionEvent class was converted from inherit to delegate with c82cb1c, the wordCount instance variable was not taken into account. This variable is read when the project is updated if the saveWordCount attribute is set for the project. This is not the case for all test files, but it is for the reference project provided. The test data is updated with 74c20a4.

crzor commented 3 months ago

Perfect. Thank you very much. Coming from ywriter this program is exactly what I wanted. Amazing work.

peter88213 commented 3 months ago

Glad to hear that. Thanks for the bug report.

crzor commented 3 months ago

Sorry, but seems this bug is still there and even critical in some circumstances:

I created the attached Project. When I try to update from a changed timeline it not only doesn't work, but afterwards the project can not be saved anymore and on exit produces an empty "ERROR: Unhandled Exception o..." message. All changes in the meantime are lost!

XXX.zip

Steps to reproduce:

  1. Create timeline
  2. Edit timeline
  3. Drag the event anywhere
  4. Exit timeline app
  5. Update timeline
  6. Change anything in the project (Chapter title f.e.)
  7. try to save - fails, bottom message stays yellow
  8. Exit nv -> unhandled exception
peter88213 commented 3 months ago

This is really bad. However, I think I can fix this, maybe tomorrow. Initial investigations show that the error occurs when updating a project that contains a "Trash" chapter. However, I want to test the plugin extensively before I release another update. Please be patient.

The thing is, I don't use Timeline myself for my daily work, but the commercial program Aeon Timeline 2. This is why the Timeline plugin isnt't that proven. Sorry for that. I developed the Timeline plugin (which is based on the yWriter-Timeline converter) when I was considering switching to Linux, where Aeon Timeline 2 doesn't work. But for now, I'll stick with Windows.

crzor commented 3 months ago

No worries. I'm just experimenting with the program before I fully commit with my new project the next couple days. Had some issues in the past and I don't want to lose work again :)

Besides the timeline bug I love what you did. Seems you had the same wishes for ywriter as I and just did it yourself.

I'm new to GitHub and unsure if it is allowed, but if there's a way to buy you a coffee or anything, let me know.

And I hope you're fine with me posting issues whenever I find them. I want to really get into the outline with my new novel, after the last one took me quite a while to fix after a narrative problem propped up.

peter88213 commented 3 months ago

When developing free open source software, you always have to rely on feedback and bug reports from users, which is perfectly fine. The problem with novelibre, as I wrote on the project start page, is that the user base is very small, and therefore the probability that bugs will be detected early.

On the other hand, novelibre has an extremely stable foundation because it uses the Python standard tk graphical user interface, which is being developed more conservatively and offers fewer features than the widely used Qt or gtk user interfaces, which are the main cause of program crashes and Linux distro issues in other writing programs created in Python.

The last error you reported is one of the worst things that can go wrong in this environment, because a plugin interferes with the application in such a way that it prevents the project from saving, among other things. This error existed from the beginning and was concealed by the first reported error, which was a pure regression of the last update. So if someone else (or myself) had used an earlier version of the nv_timeline plugin, the original serious bug would have appeared and been fixed very quickly. My nv_aeon2 plugin, which I use extensively, has very similar code in this area, differing essentially by the one line that causes the fatal error in nv_timeline.

This clearly shows how important "beta testers" are who use the program in a way that is not covered by the program tests and then also post meaningful bug reports. Thank you, again.

On the other hand, I don't want to promote novelibre because I'm developing it mainly for my own use, and don't have the capacity to discuss the amount of feature requests I see in other open source writing program projects such as novelWriter or Manuskipt. Anyway, I provide a "Discussions" forum and this public issue tracker to get feedback.

I'm very pleased that you find novelibre useful. Actually, I started with yWriter 5, where I appreciated the "external editor" and "proofread" features that allowed me to write with OpenOffice. When the .yw7 file format came up, I wrote my own file converter as an OpenOffice extension to overcome the shortcomings of the RTF format. A Python program library was created, which I also used to connect yWriter to other applications such as Timeline, Scapple, or FreeMind.

When I finally used yWriter only as a "novel manager", I replaced it with one I wrote myself, which gave me more scope to optimize my own workflow. This was novelyst, which used the .yw7 file format and was widely compatible with yWriter. What I was missing from yWriter, and what could only be provisionally implemented with its file format, was the visualization of the narrative structure and the ability to plan plot lines. That's why novelibre was created, where I have all the possibilities with my self-defined file format. I was also able to apply a lot of what I had learned about programming GUI applications in a comprehensive redesign. See also: https://github.com/peter88213/novelibre/discussions/2

In the example project you recently provided, I see that you visualize a three-act structure using parts (first-level chapters). You may wish to explore novelibre's special features for implementing narrative structures as described here. You can document your acts in an ODT document, which can be edited and re-imported like the manuscript. See here.

Thank you for offering me a coffe. I'm going to make myself a pot for breakfast now. Actually all I need is more time for my own current novel.

Cheers, Peter

peter88213 commented 3 months ago

Internal bug analysis

Writing the .novx file during update had a side effect on the project's actual model, replacing the nvTreeview delegate with a nvTree instance, where not all required methods are implemented. This is a general risk when implementing the strategy design pattern. In this case, NotImplementedError exceptions were raised, but due to the tkinter environment, they were not recognized and handled.

To minimize the risk of repeating this bug with another plugin, the nvService class in novelibre is updated with v4.2.0. It now returns Novel instances with nvTreeview delegates by default.

This bug existed as of the first version. It cannot be detected by the automatic regression tests, because they use a "standalone" environment, where side effects on the novelibre application cannot take effect at all.

A big problem caused by this bug was the fact, that the critical error happened silently, so the user could continue to make changes that could not be saved. This is to be prevented in future with https://github.com/peter88213/novelibre/issues/23 in novelibre v4.2.1.