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

Unfinished Toggl Entries Trigger an Error #2

Closed
necopinus opened this issue Mar 20, 2014 · 5 comments
Closed

Unfinished Toggl Entries Trigger an Error #2

necopinus opened this issue Mar 20, 2014 · 5 comments

Comments

@necopinus
Copy link

If rake toggl:update RAILS_ENV=production is run when there are unfinished time entries in Toggl, it fails with the message "Validation failed: Hours is invalid".

Steps to reproduce:

  1. Start a time entry in Toggl with a valid ticket number (#1234, etc.).
  2. Run rake toggl:update RAILS_ENV=production; this will fail with "Validation failed: Hours is invalid".
  3. Stop the timer in Toggl.
  4. Rerun rake toggl:update RAILS_ENV=production; everything should now work fine.
@SkyWriter
Copy link
Owner

This is somewhat intended behavior. It doesn't register the entry until it's finished. Once it's finished, it puts it into Redmine and never touches it again.

Anyway I'm open to any suggestions on how to make it better, so if you have any reasonable proposals, I'm all into them. What do you think the correct behavior should be?

@necopinus
Copy link
Author

That makes sense.

I think my suggestion then would be to generate a warning to stdout on this case, rather than throwing out a message on stderr. The case of an unclosed time entry really isn't an error, and it makes the plugin rather noisy in even a modestly active environment (5 users, in our case).

I don't mind throwing away stdout on a cron job but it's generally useful to get the output of stderr if something fails, so just running rake toggl:update RAILS_ENV=production &> /dev/null isn't a great solution.

@SkyWriter
Copy link
Owner

I've fixed this with the last commits. Would you be so kind to check it?

@necopinus
Copy link
Author

Looks good on my end. Thanks!

@SkyWriter
Copy link
Owner

My pleasure!

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