pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
304 stars 444 forks source link

Outstanding editorial task automatic email content going wrong #10214

Open yoruyenturk opened 3 months ago

yoruyenturk commented 3 months ago

Describe the bug Dear @asmecher, @touhidurabir

The Editorial Reminder task email does not return the correct list. Is it possible to update this using the determineStatus function?

To Reproduce Steps to reproduce the behavior:

  1. EditorialReminder.php prepares the task content using the review round status, but prepares it incorrectly.
  2. In the article shown in Picture 1, 1 reviewer has completed the evaluation and 1 reviewer is overdue. However, the editor of the article does not receive an overdue message in the Outstanding e-mail. Review Round table status 7 appears in the database (see Picture 2).
  3. Similarly, there is an article with round status 8 in the database, but it is overdue in the backend but not in the mail (see Picture 3). You can see the database image from Picture 4.
  4. The status statuses that appear in the system backend are not sent in the outstanding task e-mail. While the system shows notification using REVIEW_ASSIGNMENT_STATUS_XXX, the outstanding task email is sent using REVIEW_ROUND_STATUS_XXX.
  5. It would be very helpful if jobs/email/EditorialReminder.php could be updated to provide a correct list.

What application are you using? OJS version 3.4.0-5

Additional information Picture 1. image

Picture 2. image

Picture 3. image

Picture 4. image

PRs

Stable 3.4.0

pkp-lib --> https://github.com/pkp/pkp-lib/pull/10332 ojs --> https://github.com/pkp/ojs/pull/4407 [TEST ONLY]

Vitaliy-1 commented 3 months ago

I cannot reproduce the bug described here. Just to confirm, the editorial reminder is sent but it doesn't contain the "A review is overdue" message or the whole editorial reminder email isn't sent?

yoruyenturk commented 3 months ago

I cannot reproduce the bug described here. Just to confirm, the editorial reminder is sent but it doesn't contain the "A review is overdue" message or the whole editorial reminder email isn't sent?

Hi @Vitaliy-1 ,

“A review is overdue” is going. However, cases with a status of 7 or 8 in the database and one or more reviewers are overdue are not included in the e-mail.

yoruyenturk commented 3 months ago

For example, in the article in Picture 1, a referee is displayed as overdue. However, it is not included in the editorial task mail. Because in Picture 2, the status in the database is 7. Editorial Reminder only includes those with status 10 in the list.

Vitaliy-1 commented 3 months ago

Hmm, review round status 7 and 8 shouldn't be assigned if the review is overdue...

yoruyenturk commented 3 months ago

Hmm, review round status 7 and 8 shouldn't be assigned if the review is overdue...

You are right, but I can see a similar situation in many articles.

When I updated the code in jobs/email/EditorialReminder.php as determineStatus instead of getStatus, it worked. It may be a bug that the status stays at 7 and 8.

touhidurabir commented 2 months ago

Probably our implementation approach has some issue here. Here we are making decision based on last review round's status but we probably need to check the any active review assignment associated with that review round and make decision based on those review assignments' status . Another approach can be replace the getStatus with determineStatus for checking as @yoruyenturk has described but not possible to confirm without some testing .

About the review round get the status 7 or 8, if I am not mistaken , it will be updated to those value for a review round when any one the review assignment in that review round is pending or any review is submitted for editor to look at . Seems like this checking is bit confusing .

touhidurabir commented 3 weeks ago

I am able to reproduce the issue where getStatus and determineStatus return value . When a reviewer get assigned and accepted the review request , the both the getStatus and determineStatus return REVIEW_ROUND_STATUS_PENDING_REVIEWS ==> 7 that is Waiting for reviews to be submitted by reviewers . But once the review submission due date exceed , the getStatus still returns REVIEW_ROUND_STATUS_PENDING_REVIEWS ==> 7 but the determineStatus return REVIEW_ROUND_STATUS_REVIEWS_OVERDUE ==> 10 . This mainly happens as we do not have any schedule/cron to automatically update the review round status once the due date exceed . However as the determineStatus get to check based on review assignment at run time , it returns different result .

Also in the EditorialReminder job , we are deciding if outstanding based on the following statuses of review round

  1. REVIEW_ROUND_STATUS_PENDING_REVIEWERS --> 6
  2. REVIEW_ROUND_STATUS_REVIEWS_COMPLETED --> 9
  3. REVIEW_ROUND_STATUS_REVIEWS_OVERDUE --> 10
  4. REVIEW_ROUND_STATUS_REVISIONS_SUBMITTED --> 11

so it does not consider the REVIEW_ROUND_STATUS_PENDING_REVIEWS ==> 7 (Waiting for reviews to be submitted by reviewers) and REVIEW_ROUND_STATUS_REVIEWS_READY --> 8 (One or more reviews is ready for an editor to view) .

One way to solve it to include the REVIEW_ROUND_STATUS_PENDING_REVIEWS ==> 7 and REVIEW_ROUND_STATUS_REVIEWS_READY --> 8 in the list of status based on which the outstanding get calculated . And that seems easy one .

Another approach can be to have a scheduler to update the review round status to REVIEW_ROUND_STATUS_REVIEWS_OVERDUE --> 10 when due dates exceeds .

@Vitaliy-1 what do you think ?