-
Notifications
You must be signed in to change notification settings - Fork 6
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
WIP: Fix 500 when last-modified missing in Redis #136
Conversation
The change looks good to me, I'm going to write a spec to go with it, because right now the specs are still green with this change |
I have added specs in 21a5700 |
So you think it should be a normal case that Maybe it's for old files, before we stored it? |
It's definitely not a normal case, I have checked the code. In the new spec I have manually deleted the You're right, it must be for files that were created before we started storing the date from the S3 response as |
Actually, I can't find a point in time where liquor-cabinet did not store a Last-Modified date. Before d05cd4a it would do a head request on the newly created file, and since that it's using the Date header from the PUT request's response Almost two years ago we added the Last-Modified to the listings in 60c508f, but the values were always stored in Redis |
So then it's actually not expected that it would ever be empty. Meaning at least the staging data is corrupt. In which case specs for it wouldn't really be justified in my opinion, as they describe expected behavior. I think it should at least log a warning, but also keep logging an exception to Sentry, even if it would deliver listings without |
I found a file on staging that has a Last-Modified stored in Redis that looks like this: "2018-04-11 15:09:02 +0000". When turned into an integer by the |
Closing this one, because it is a valid exception that should raise in the future in case someone's data is inconsistent. We fixed the wrong entry in Redis. |
I have trouble running the tests on my machine, so this is just an untested idea for a quick fix for now.
fixes #135