-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Describe the bug
When in an external review workflow, no email is sent when transitioning to external review.
To Reproduce
Steps to reproduce the behavior:
- Create a request with external review submission
- Assign a reviewer
- Progress the submission to External Review
- See that no email is sent to reviewers
- Progress the submission to Close Review
- See an email sent to reviewers
Expected behavior
An email is sent when transitioning to the External Review step
Affected roles
- Reviewers
Additional context
It is most like related to this change setting instance to the state before the transition happens, which causes the messaging pipeline to not fire off since it only finds reviewers: 60ce996
See the line @status_field.on_success(). That fires before the instance is saved, and so all the messaging framework is working with a submission before it's actually been updated. Of note in the messaging framework, in email.py, in def reviewers, there's source.phase.permissions.can_review(reviewer) which will fail if the submission is not currently in a review phase. Interestingly enough, this is why the email gets fired when the submission moves OUT of the review phase (either reverting, or moving forward)
This may be the cause of #4678.