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
Make sure timestamps are valid #2253
Conversation
Sometimes restic gets bogus timestamps which cannot be converted to JSON, because the stdlib JSON encoder returns an error if the year is not within [0, 9999]. We now make sure that we at least record _some_ timestamp and cap the year either to 0000 or 9999. Before, restic would refuse to save the file at all, so this improves the status quo. This fixes #2174 and #1173
Codecov Report
@@ Coverage Diff @@
## master #2253 +/- ##
==========================================
+ Coverage 50.8% 50.94% +0.14%
==========================================
Files 178 178
Lines 14530 14529 -1
==========================================
+ Hits 7382 7402 +20
+ Misses 6080 6063 -17
+ Partials 1068 1064 -4
Continue to review full report at Codecov.
|
Thanks a lot Alex. |
Thanks for the feedback! Yeah, that's the effect of the |
Hi Alex, This is the original file:
This is the restored file:
I'll would be happy to help if you need something else. |
Thanks for the stats, it looks like all timestamps are bogus. Huh. So I don't particularly care about that and will merge this PR now ;) |
What is the purpose of this change? What does it change?
Sometimes restic gets bogus timestamps which cannot be converted to JSON, because the stdlib JSON encoder returns an error if the year is not within [0, 9999]. We now make sure that we at least record some timestamp and cap the year either to 0000 or 9999. Before, restic would refuse to save the file at all, so this improves the status quo.
Was the change discussed in an issue or in the forum before?
closes #2174, #1173
Checklist
changelog/unreleased/
that describes the changes for our users (template here)gofmt
on the code in all commits