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

Assertion `is_open () || end >= start #586

Open
Spreadcat opened this issue Jan 18, 2024 · 4 comments
Open

Assertion `is_open () || end >= start #586

Spreadcat opened this issue Jan 18, 2024 · 4 comments

Comments

@Spreadcat
Copy link

Hi there,

What Version
Timewarrior 1.7.0
OS Fedora 39
Python 3.11.7

Under certain conditions and not related all commands, I get an error message as output.
For Example:

When I run timew s :week :ids I should get the normal summary output.
Instead I get

$ timew s :week :ids
timew: /builddir/build/BUILD/timew-1.7.0/src/Range.cpp:358: time_t Range::total() const: Assertion `is_open () || end >= start' failed.
Aborted (core dumped)

More information:

  • As soon as I drop :week, the command is working.
  • If I replace :week with :lastweek, the command is working. I could not find any other way to reproduce the problem than to include :week.
  • I can reproduce the same error on a different machine with package version.
  • The problem is persistent in 1.4.3 as well.
  • I cleared the timewarrior.cfg file of any entries and the error persists.
@lauft
Copy link
Member

lauft commented Jan 20, 2024

It would be good to know the "certain conditions" that led to the error.

Can you provide the steps to reproduce it? What is the output when you add the :debug hint to the failing command?

@Spreadcat
Copy link
Author

I know "certain conditions" would came back right at me. I meant the situation where I inlcude ":week" into the command.
I'll test this on a container and provide steps on how to reproduce.

The output with the ":debug" attached

$ tm s :week :debug
CLI Parser
  _original_args
    timew s :week :debug
  _args
    word basename='timew' raw='timew' BINARY 
    word canonical='summary' raw='s' ORIGINAL EXT 
    word canonical=':week' raw=':week' ORIGINAL HINT FILTER 
    word canonical=':debug' raw=':debug' ORIGINAL HINT FILTER 

>> Hint :day expanded to 2024-01-20T00:00:00 - 2024-01-21T00:00:00
>> Hint :week expanded to 2024-01-15T00:00:00 - 2024-01-22T00:00:00
>> 2024-01.data: 41 intervals
>> Loaded 18 tracked intervals
timew: /builddir/build/BUILD/timew-1.7.0/src/Range.cpp:358: time_t Range::total() const: Assertion `is_open () || end >= start' failed.
Aborted (core dumped)

@Spreadcat
Copy link
Author

I think I found a way to reproduce the issue:

with this data (only two lines required) the issue can be reproduced:

inc 20240116T181659Z - 20240116T151438Z # work
inc 20240117T073000Z - 20240117T150352Z # work

The issue is that the first line contains a timestamp earlier than the starting time.
I'm not sure how I ended up with this line. I certainly cannot exclude any manual editing of the file, though -> Then I am probably the one to blame for this error.

Since I now know now how to find and fix this problem, I guess the issue can be closed. Alternatively you can use this to add a check/error-message to check for this constelation, caused by idiots like me typing in the wrong timestamps manually.

@lauft
Copy link
Member

lauft commented Jan 21, 2024

Adding a error message with a hint to this probable cause might be something to consider... 🤔

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