weektodo
weektodo copied to clipboard
Modifications don't apply on reccurrent tasks
Problem:
Create a task Make it recurrent Change the name of the task
Expected Behavior: All the recurrent tasks are modified Actual Behavior: The recurrent tasks are not modified. Worse: New ones acre created, which make them being doubled.
Hi @qdorleat. Yes, I have to rethink the entire recurrent task system.
The thing is that this is different from a simple calendar. Here the task have a state (checked and position in day) so I had to make some magic to persist that and I if you look closer when you create a repeating task you can't edit the task.
For next version, I will try to fix this and reimplement the entire system.
The recurrent tasks are not modified. Worse: New ones acre created, which make them being doubled.
In this scenario when you edit a task is taking away from the recurrent system so that task is no a recurrent task.
Hi @qdorleat. Yes, I have to rethink the entire recurrent task system.
The thing is that this is different from a simple calendar. Here the task have a state (checked and position in day) so I had to make some magic to persist that and I if you look closer when you create a repeating task you can't edit the task.
For next version, I will try to fix this and reimplement the entire system.
The recurrent tasks are not modified. Worse: New ones acre created, which make them being doubled.
In this scenario when you edit a task is taking away from the recurrent system so that task is no a recurrent task.
Hi, I have the same issue. I was searching issues to see if there is an accepted feature request for this to develop it, but it doesn't have. I can implement this if you want. If you want I can message you the details of how I am planning to do it. 🤷♂️
Hi @bagheriali2001 thanks a lot, if you can take care of that that will be awesome!
First let me put you in context of the current state of the recurring tasks, because unfortunately it is something with a large technical debt.
When I started weektodo I thought it was going to be a simple thing and I did it with a view to implementing some file-based cloud synchronization system in the future. So to avoid the use of many files (one for each task) it is now implemented in such a way that the tasks are stored in blocks, each block being a day and inside there is a list of tasks.
The theme of recurring tasks is implemented in such a way that when a task is generated, the base task is created, which is then instantiated on each of the days. The problem with weektodo is that unlike common calendars, the tasks have a state (active or not and the position in the list is changed manually). This does not allow you to only work with the pivot task and have to instantiate a task. on the lists as appropriate.
Having said that, now when a recurring task is created, the pivot is generated and a temporary list of the tasks is created according to the days in which it has already been instantiated in order to maintain the reference in case the task is deleted
Right now when any task is edited, every time a change is made it is automatically saved in the DB (to eliminate the step of the user having to save manually), if we were to edit a task we have to add a different flow since it would be very inefficient do the update every time a change is made and we should add a button to modify only the instance of the task or all the tasks that follow.
The work to edit the task is not that complicated, but having an inconsistent base due to what I explained before can cause some inconvenience when implementing this feature, which is why I was considering reimplementing the entire task system to then just have to make the change in the pivot task for the new instances.
Let me know what you think about this and in any case if you want to implement this I am happy to help with whatever you need.
So I have an Idea, but unfortunately, it will take some time for me to implement(Some things came up recently). But to say it, we would be still using the same structure, but we would use a cache to display the todo list of the future date. Then any change to the todo list will update both the cache and main data. Then at 00:00, the cache of the next day will be appended to the main data. This cache would not be exported.
The only issue is the problem with the timing issue. It would appear that when the computer goes to sleep the setTimeout method would stop counting (at least in MacOS). So I would be changing all the timeouts that have something to do with data and data display to a central location. The timeout would be a max of 60 seconds and the min value would be the next 00 seconds on the clock. It will check and push the notification and if it is not on the new day, update the todo list. So in this case, if the user can update the recurring task it will updated for the next occurrences.
So yeah that's it. And I'll try to do this by the end of this month.
Has there been any progress?