zztin / ctimer

This is a python implementation of a famous time management technique. CTimer helps you keep track of your productivity during the day, and help you set realistic goals for your day.
Apache License 2.0
0 stars 1 forks source link

v2.0.1 or later does not record finished clocks if their corresponding/following break does not complete #46

Open tai271828 opened 3 years ago

tai271828 commented 3 years ago

Description

CTimer does not record finished clocks if their corresponding/following break does not complete.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Launch timer
  2. Complete one or more clock
  3. Interrupt the following/corresponding break by clicking stop
  4. Close timer
  5. Re-launch timer

Expected Behavior

Total clocks number continues before closing the timer.

Actual Behavior

Total clocks number does accumulate.

zztin commented 3 years ago

Correct. This should be also related to #23.

ctimer.py:line10 on_closing() is supposed to record the current clock details while halting the program. Need to be checked. controller.py:line82 db.db_add_clock-details() is also related.

To solve this problem, we need to update the database clock details only once but not to miss premature halted clocks.

zztin commented 3 years ago

I propose to fix the database to record any running period of "focus-time" and "breaks" by adding one columns and delete the "end_break" column. This means the former database needs a conversion to be compatible with the new database.

New data format A. add 1 column: "is_break" Bool & remove "end_break" column id | date | clock_count | start_clock | end_clock | is_break | task_description | reached_bool | reason

clock_count will remain the "finished focus-clock count" of the date. while is_break == True, the task_description & reached_bool & reason will be N.A.

While retrieving clock count for the year, the method does not change. While plotting --stats, the breaks taken would be plotted as different color.

zztin commented 3 years ago

This will be developed in a new branch --new_db, with the database name: ctimer_2021.db and ctimer_debug_2021.db before the merging take place.

zztin commented 3 years ago

the new branch is merged into master by commit 0f71031dea80c9ae949208a15c12cb4ce5394a5e Test cases is to be written.