-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
recorder: resume logs recorded within 4 hours #3136
Conversation
We now look at the latest log's last timestamp - if it was within four hours, we prompt the user to resume recording to that file. Fixes espruino#3135
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be clarified that the file name is in UTC not local time?
This unlikely to affect people not living in GMT+-1
Additionally, I feel like forcing the recorder to append should always append to the latest file, regardless of the time difference
apps/recorder/ChangeLog
Outdated
@@ -45,3 +45,4 @@ | |||
0.36: When recording with 1 second periods, log time with one decimal. | |||
0.37: 1 second periods + gps log => log when gps event is received, not with | |||
setInterval. | |||
0.38: Resume previous recorder logs, if within four hours - regardless of date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to clarify that the previous recorder log is only resumed on append
Very good point - I think that since we now look at the times within the file, the filename is less important (so long as it still sorts by date), so we could make it that the filename is in localtime (but keep the timestamps themselves in UTC), so when you look at the files they're in your timezone.
That makes sense - how does this sound as a proposed flow? Any tweaks/additions?
(I'll leave this PR open here - feel free to add changes on if you like, I'm not sure when I'll next be free to pick it up) |
I like the idea, but have you actually tested this in practise? Because iterating over the entire file to find the last line could take quite a long time (10+ seconds depending on the track length) and I think that would provide quite a poor experience if you user just wants to start a run. At minimum it should at least check the filename date and if it's different, skip the check. ... plus this feels like quite a lot of extra complexity? I'm not sure really sure if it's worth it? |
Conflicts: apps/recorder/ChangeLog apps/recorder/metadata.json
Good point - @Mineinjava is this an issue you still see? Either way I'd like to keep the tests (and fix the lint warnings), I'll split out to another PR if necessary (and if you agree the tests are good to have) |
Honestly I think the best solution is to
|
Yeah that seems reasonable, I'll make some progress towards that as part of this PR |
This has been subsumed by #3431, closing |
We now look at the latest log's last timestamp - if it was within four hours, we prompt the user to resume recording to that file.
This change also adds (manually runnable) tests for
setRecording()
Fixes #3135