Skip to content

Commit 4dcafce

Browse files
committed
fix timezone caching bug, fixes CNVS-7204
make sure we use the timezone-specific date in the cache key (Date.today isn't timezone aware) test plan: 1. make sure you have redis enabled 2. set your canvas timezone to something other than UTC 3. create an assignment that is due tomorrow at midnight (in said timezone) 4. view your dashboard sometime in the window where your "today" != UTC "today". for example, if you are on MDT, that would be sometime between 6pm and midnight 5. Coming Up should list it as "Tomorrow" 6. check it again tomorrow *before* that window (e.g. before 6pm MDT) 7. Coming Up should list it as "Today" (prior to this fix it would list it incorrectly as "Tomorrow" from 12am-6pm) Change-Id: Ib3c9e74388741ad5f74ebd9ead3f07dd63552dff Reviewed-on: https://gerrit.instructure.com/22731 Reviewed-by: Jon Jensen <jon@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> Product-Review: Marc LeGendre <marc@instructure.com> QA-Review: Marc LeGendre <marc@instructure.com>
1 parent 34e4252 commit 4dcafce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/views/courses/_recent_event.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
submission || 'no_submission',
1919
recent_event || 'blank_event',
2020
(recent_event.due_at if is_assignment),
21-
Date.today,
21+
Time.zone.today,
2222
Time.zone.name,
2323
recent_event.cached_context_grants_right?(@current_user, nil, :manage_grades),
2424
recent_event.cached_context_grants_right?(@current_user, nil, :participate_as_student)

0 commit comments

Comments
 (0)