-
Notifications
You must be signed in to change notification settings - Fork 57
Reservations being marked incorrectly as Returned Overdue #1381
Comments
Ok, this basically seems to be an issue with our migration from when we were dealing with dates. We basically need to convert all of the relevant reservation fields to the local time zone before we do the type conversion from I'm going to end up editing the relevant migration ( |
I'm a bit confused - we only changed the |
Ohhh, wait a sec. This could be due to #1220 where we have a migration ( |
Ok, definitely due to that migration, tweaking it now. |
While I'm in there I'm going to update the migration to be model-independent as well. |
All done! This was fun - it really highlights the fact that we need to be careful with any migrations that manipulate data in the database, and that time zones are nothing to be trifled with. I had to add some methods to the migration class to replicate the I'm just testing the new migration with the old BMEC dump and, assuming everything works, I'll open a PR 😄. |
Ok, it worked! Unfortunately, my first attempt at the new migration increased the time it took by over 500%. Trying some brief refactoring now... |
Resolves #1381 - accounts for time zone issues with late check-in - decouples migration from Reservation model
Resolves #1381 - accounts for time zone issues with late check-in - decouples migration from Reservation model
Didn't work 😞, opening PR's now. Since it's just a one-time thing I'll leave it for now. If I've got time to try and profile the migration to figure out what's slowing it down, I will, but I'm not sure how to do it quickly (given how long all of these migrations take). |
It appears as though we're running into time zone issues again, as a number of reservations that were checked in after midnight UTC (but before midnight EST) on their due date are being flagged as overdue. For example, see Reservation number 43479 on BMEC (or 40511 if working with the earlier database dump).
One possibility is that the issue is due to the fact that the reservations database entries were created in v3.4, before #939, and as such they're being incorrectly flagged in v5.5. If that's the case, we might want to add a database migration that correctly tweaks dates so that we don't run into this issue. This is high priority.
The text was updated successfully, but these errors were encountered: