jelu
jelu copied to clipboard
Bug: currently reading events deleted after adding a finished one.
Hello,
I am experiencing a strange bug when adding reading events to a book. Basically I import a new book into Jelu and create a "currently reading" event with a today date. Everything works fine. Then after some days that I finish reading the book I go to Jelu again and add (+event) a new finished event with the current date (several days after the "currently reading" date). I am expecting to have two events now in the book: a started"currently reading" and a "finished" one. However, I always end up having just one "finished" event, and the "currently reading" is deleted.
Is this the expected behaviour? If I manually add the "currently reading" again, it is kept.
I hope I have managed to explain myself....
Hi, this is a deliberate behaviour, I chose to make the currently_reading state a transition only state. As soon as you mark a book finished or dropped, the latest currently_reading event gets updated to finished or dropped.
I'm guessing you're asking this because maybe you would like to track the time elapsed between the moment you flagged a book as currently_reading and the moment you flag it finished ?
This span of time can be retrieved on the event itself : the creation_date of the event is the moment you flagged it as currently_reading and the modification_date is the date of the latest modification on the event : so the moment you marked it as finished or dropped.
If this kind of data is important to you maybe Jelu could display those dates on the events so that you can see how long it took you to finish a book ?
Hello,
Yes, you are right, I am really interested in keeping track of the elapsed time between reads (in my case they correlate much more to how much I liked the book than the size of it XD). I really like the Jelu view where events are displayed on a timeline and you can see when you started the book and when you finished it (by the way, completely off-topic but having a stats page with a similar timeline for all books on jelu would be great to see :)
I see the "creation_date" of the event more like a database/internal thing, where you keep info when the event was created, but mixing the event types themselves (currently_reading and finished) with their respective creation_date does not seem right to me. I would prefer that when adding a "finished" event it does not modify the existing one. You can always modify it double clicking the existing one. To me it seems more consistent with what a "+event" button would do. Of course, completely your call on this!
I am now thinking that of course a "finished" event should always be related to a "reading" event, however, the inverse relation does not hold as you can have a "reading" event completed by a "drop" event. I guess it depends on the internal structure of how Jelu handles things.
Are you considering events as always having a "reading" date and then one of the two "finished" or "drop" dates can also be activated for it? In my mind events where separated into 3 clases: "reading", "drop" and "finished" with no relation to each other. Maybe that's where my confusion comes.
The actual definition of a ReadingEvent is here : https://github.com/bayang/jelu/blob/main/src/main/kotlin/io/github/bayang/jelu/dao/ReadingEventTable.kt
Yes, a finished event and a dropped event have to be related to the initial currently reading event.
When you say : Are you considering events as always having a "reading" date and then one of the two "finished" or "drop" dates can also be activated for it? In my mind events where separated into 3 clases: "reading", "drop" and "finished" with no relation to each other. Maybe that's where my confusion comes.
It is exactly this : when an event is created it is a currently_reading and there are only two ends possible : either you finish the book or either you drop it.
After much thinking in the initial stages of Jelu I decided to implement events like they are today for the following reasons (among others) :
- no need for multiple events linked between each others
- each event is a self contained reading session (from start to end, whether you read the book until the end and finish it or not)
- currently_reading is present tense, it is an ongoing event, a duration. Finish or drop is a specific moment, it is a timestamp. Using a single entity to represent different ideas that are durations and timestamps felt a bit odd to me. So I decided to make finished and dropped the last modification of an existing duration event.
It is still possible I guess to edit events from the UI.
I know it is a bit different from common conceptions of events in software, but it works quite fine for the moment. I think I'll add a summary of the discussion we just had in the documentation, it might be useful for other people as well (especially for those wanting to use the API)
I understand your reasons @bayang.
However, would it be possible to?
- Show both dates on the timeline (started reading and finished/drop reading) of a book? Right now only the finished one is shown instead of started reading and finished/dropped.
- Being able to edit both the starting date and end/drop date of an already created event?
I think it'll be much easier to understand the behaviour of jelu's book events if these things are possible.
EDIT: maybe adding a "started" event as a timestamp (similar to "finish" or "drop") can also help??
Hi @bayang,
Did you have time to look at this? What do you think about showing the starting date and the ability to change it?
Regards,
Hi @jrhbcn I'm currently working on it. The start date will now remain visible and it will be possible to edit the start date end end date. I can't provide a delivery date but this is the next feature to be released.
So glad to hear that! Of course feel free to take all the time you need. Let me know if I can help you test it (I'm sorry I cannot help more as my java knowledge is really rusty).
I'll probably make a release soon @jrhbcn
During the upgrade, for all existing events the new startdate will be set to the existing creation date
And for for ending events (finished and done) the end Date will be set to the existing modificationDate.
There might be some weird cases that will need to be edited by hand after migration to make things look nice, but after that we'll be fine.
Just remember to backup your database before upgrading.
Should be fixed in v0.33.0