Skip to content
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

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

Open
tai271828 opened this issue Dec 30, 2020 · 4 comments

Comments

@tai271828
Copy link
Collaborator

tai271828 commented Dec 30, 2020

Description

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

  • ctimer version: v2.0.1
  • Python version: 3.8.3
  • Operating System: ubuntu-mate 18.04

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.

@tai271828 tai271828 changed the title v2.0.1 or later does not start from the existing clock numbers in the same day v2.0.1 or later does not record finished clocks if their corresponding/following break does not complete Dec 30, 2020
@zztin
Copy link
Owner

zztin commented Dec 30, 2020

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
Copy link
Owner

zztin commented Jan 6, 2021

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
Copy link
Owner

zztin commented Jan 6, 2021

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
Copy link
Owner

zztin commented Jan 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants