Project

General

Profile

Actions

Feature #31225

closed

Show the number of days left until the due date in reminders

Added by Go MAEDA about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Email notifications
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

It is useful if we can know the due date of each issue in reminder. I think that adding information "Due in X days" or "X days late" for each issue is nice.

[Before]

* eCookbook - Bug #1: Cannot print recipes
* OnlineStore - Bug #4: Issue on project 2
* eCookbook - Feature request #2: Add ingredients categories

[After]

* eCookbook - Bug #1: Cannot print recipes (Due in 3 days)
* OnlineStore - Bug #4: Issue on project 2 (Due in 1 days)
* eCookbook - Feature request #2: Add ingredients categories (3 days late)


Files

31225_show_days_until_due_date.patch (3.92 KB) 31225_show_days_until_due_date.patch Yuichi HARADA, 2019-05-17 04:24
31225_fix_test.patch (8.09 KB) 31225_fix_test.patch Yuichi HARADA, 2019-05-20 07:22
31225_fix_test_v2.patch (5.32 KB) 31225_fix_test_v2.patch Yuichi HARADA, 2019-05-22 02:45
24941_set_time_zone_to_utc.patch (2.62 KB) 24941_set_time_zone_to_utc.patch Go MAEDA, 2019-05-22 06:49

Related issues

Related to Redmine - Patch #6357: Show and sort by due_date in remindersClosed2010-09-10

Actions
Related to Redmine - Feature #23778: default sort email reminders by due date (and list due date in email)Closed

Actions
Actions #1

Updated by Go MAEDA about 5 years ago

I noticed a few weeks ago that reminders from Planio already has the information. It is really useful.

Actions #2

Updated by Go MAEDA almost 5 years ago

  • Related to Patch #6357: Show and sort by due_date in reminders added
Actions #3

Updated by Go MAEDA almost 5 years ago

  • Related to Feature #23778: default sort email reminders by due date (and list due date in email) added
Actions #4

Updated by Yuichi HARADA almost 5 years ago

+1
I think it is useful because I can understand the number of days until the due date.
I attached a patch.

Actions #5

Updated by Go MAEDA almost 5 years ago

  • Target version set to Candidate for next major release
Actions #6

Updated by Go MAEDA almost 5 years ago

  • Target version changed from Candidate for next major release to 4.1.0

I applied this patch to my production environment and found that the information "Due in X days" / "X days late" is useful. It made me realize that there were too many overdue issues!

I am setting the target version to 4.1.0.

Actions #7

Updated by Go MAEDA almost 5 years ago

  • Subject changed from Show how many days are left until the due date in reminders to Show the number of days left until the due date in reminders
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thanks.

Actions #8

Updated by Go MAEDA almost 5 years ago

  • Status changed from Closed to Reopened

The tests fail depending on the timezone.

I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on 20 May 2019 08:15:00 +0900 (19 May 2019 23:15:00 UTC)

F

Failure:
MailerTest#test_reminders_should_sort_issues_by_due_date [/Users/maeda/redmines/trunk/test/unit/mailer_test.rb:749]:
<(?-mix:foo \(1 day late\))> expected but was
<eCookbook - Bug #219: foo (2 days late)>..
Expected 0 to be >= 1.

bin/rails test test/unit/mailer_test.rb:738
Actions #9

Updated by Yuichi HARADA almost 5 years ago

Go MAEDA wrote:

The tests fail depending on the timezone.

I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on 20 May 2019 08:15:00 +0900 (19 May 2019 23:15:00 UTC)

[...]

Sorry, I fixed to the UTC Date at 0:00 using travel_to Date.today.to_time(:utc) .
This fix eliminates the dependency on time zones.

Actions #10

Updated by Go MAEDA almost 5 years ago

Yuichi HARADA wrote:

Sorry, I fixed to the UTC Date at 0:00 using travel_to Date.today.to_time(:utc) .
This fix eliminates the dependency on time zones.

Unfortunately, tests still fail.

$ date
Tue May 21 00:22:38 JST 2019
$ bin/rails test test/unit/mailer_test.rb:622
Run options: --seed 55322

# Running:

F

Failure:
MailerTest#test_reminders [/Users/maeda/redmines/trunk/test/unit/mailer_test.rb:628]:
"Bug #3: Error 281 when updating a recipe (5 days late)" not found in "1 issue(s) that are assigned to you are due in the next 42 days::

* eCookbook - Bug #3: Error 281 when updating a recipe (6 days late)

View all issues (2 open)
http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://hostname/my/account
" 

bin/rails test test/unit/mailer_test.rb:622

Finished in 1.727797s, 0.5788 runs/s, 2.3151 assertions/s.
1 runs, 4 assertions, 1 failures, 0 errors, 0 skips
Actions #11

Updated by Yuichi HARADA almost 5 years ago

When replacing Time with Date, due_date was incorrect because timezone and time were truncated.
I rebuilt a test.

Actions #12

Updated by Go MAEDA almost 5 years ago

Yuichi HARADA wrote:

When replacing Time with Date, due_date was incorrect because timezone and time were truncated.
I rebuilt a test.

Thank you for updating the test. I wrote a simpler patch.

The root cause of the test failure is that a time zone is not set for users in test fixtures. Because of that, the time zone of users while running test depends on the timezone of the PC, and the result of test will be unstable.

This patch fixes the problem by fixing the user's time zone to UTC while running mailer_test.

Actions #13

Updated by Go MAEDA almost 5 years ago

  • Status changed from Reopened to Closed

Go MAEDA wrote:

The tests fail depending on the timezone.

I think the error occurs when the date of the current timezone is different from the date in UTC. For example, I observed the following error on 20 May 2019 08:15:00 +0900 (19 May 2019 23:15:00 UTC)

[...]

Committed the fix #31225#note-12 in r18190.

Actions

Also available in: Atom PDF