Skip to content

Fixes for task email notifications - release 1.8.2

Vaibhav Rathore requested to merge feature/1409/release-fixes into 1.8.2-release-branch

Targets #1409 (closed)

Summary

  1. Email suppressing logic has been added to release branch
  2. The issue with task email notification scheduler was in the following two scenarios:
    1. When the recipient has been set to one of author/reviewer/editor
    2. When the recipient is set to assignee and assignee is set to author/reviewer/editor
  3. The issue was at two places in the code:
    1. The get latest manuscript function was returning a promise hence leading to UUID error in the query
    2. The SQL query to fetch team member where status is not in invited and rejected, it was also excluding the team members with NULL status.
    3. The NULL status would be set for team members where we do not send any invitation. For example, editors and the default author of a manuscript (who created the manuscript).
  4. The code fixes addresses these two issues in the code

Note for SQL query

I'm unsure of why postgres excludes the team members with null status. In order to replicate and understand this behavior, try the following steps:

  1. Create a manuscript and assign editors to it
  2. The editors would be added to team members with status = null
  3. Run the following query, which was the old version of the code
select * from team_members
where team_id in (
  select id from teams
  where object_id='manuscript-id'
  and role in ('editor', 'seniorEditor', 'handlingEditor')
)
and status not in ('invited', 'rejected');
  1. In the above query, you will notice it returns an empty result set
  2. The correct version of the query is below (which is how the code has been modified)
select * from team_members
where team_id in (
  select id from teams
  where object_id='manuscript-id'
  and role in ('editor', 'seniorEditor', 'handlingEditor')
)
AND (status IS NULL OR status NOT IN ('invited', 'rejected'));

Merge request reports