TatriX / pomidor

Pomidor is a simple and cool pomodoro technique timer.
238 stars 17 forks source link

Error saving session #44

Closed dchrzanowski closed 4 years ago

dchrzanowski commented 4 years ago

Bug:

Calling the (pomidor-save-session) function just after the first pomidor is started works fine and a json file is produced, however, after a creating a break or a creating a hold the (pomidor-save-session) function throws an "Invalid time specification" error:

Debugger entered--Lisp error: (error "Invalid time specification")
  format-time-string("%Y-%m-%dT%H:%M:%S" t)
  #f(compiled-function (time) #<bytecode 0x9c271ec2081b>)(t)
  #f(compiled-function (pomidor) #<bytecode -0x86407c34172680>)((:started (24343 20787 718240 292000) :break (24343 20794 707865 330000) :stopped (24343 20797 516015 602000) :snooze t))
  mapcar(#f(compiled-function (pomidor) #<bytecode -0x86407c34172680>) ((:started (24343 20787 718240 292000) :break (24343 20794 707865 330000) :stopped (24343 20797 516015 602000) :snooze t) (:started (24343 20797 516025 134000) :break nil :stopped (24343 20807 544929 452000) :snooze nil)))
  -map(#f(compiled-function (pomidor) #<bytecode -0x86407c34172680>) ((:started (24343 20787 718240 292000) :break (24343 20794 707865 330000) :stopped (24343 20797 516015 602000) :snooze t) (:started (24343 20797 516025 134000) :break nil :stopped (24343 20807 544929 452000) :snooze nil)))
  pomidor-save-session()
  eval((pomidor-save-session) t)
  eval-expression((pomidor-save-session) nil nil 127)
  funcall-interactively(eval-expression (pomidor-save-session) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
wandersoncferreira commented 4 years ago

hi, @dchrzanowski. Could you provide what is the Emacs version you are using? And just to be sure, if you remove the json file and start over with a clean state, this still happens?

TatriX commented 4 years ago
(format-time-string "%Y-%m-%dT%H:%M:%S" t)

throws an error for me. I'm not yet sure from where t comes.

TatriX commented 4 years ago

Probably it comes from

:snooze (funcall fmt-time (plist-get pomidor :snooze))

As far as I can see, :snooze is bool so it shoudn't be formated with fmt-time. @wandersoncferreira will you take a look?

wandersoncferreira commented 4 years ago

Yes, I can submit a PR. Can you confirm for me something else about a related issue? The function time-equal-p does not seems to be included in Emacs 26. At some point the time-less-p was changed to time-equal-p and probably this exist in Emacs 27.

TatriX commented 4 years ago

At some point the time-less-p was changed to time-equal-p and probably this exist in Emacs 27.

Well, both functions exist in Emacs 27 as they do different things. My bet is time-equal-p is here because it takes into consideration various time formats, but I'm guessing here.

TatriX commented 4 years ago

Please reopen if needed

dchrzanowski commented 4 years ago

hi, @dchrzanowski. Could you provide what is the Emacs version you are using? And just to be sure, if you remove the json file and start over with a clean state, this still happens?

Sorry @wandersoncferreira I probably should have said that I'm using emacs 28, 28.0.50 to be exact. It is important info after all.