Skip to content

Conversation

@gabeparra01
Copy link
Contributor

Resolves #4857

Description

Local testing showed that the schedule_reminder_email method works as expected. The issue seems to be that the method is only called in the controller's update method when it should also be called in the create method.

There was an edge case concern discussed here. I debugged the workflow for updating an existing distribution and confirmed that the updated issued_at date is being used to reschedule the reminder email. Please see the screenshot attached below. Although, I do not know if the previous reminder email would be canceled. I think I could add a method here to check for old reminders? But that is another edge case.
Distribution attributes in update method

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

This was tested locally and I took the following steps:

  1. Login as a bank user
  2. Navigate to request tab
  3. View a request
  4. Fulfill a request
  5. Change the issue_date to a day in the future
  6. Select the "Send email reminder the day before?" checkbox
  7. Fill out required fields
  8. Data requirements:
  • The request must belong to a partner that allows email notifications
  • issue_date must be at least 24 hours in future
  1. Save changes
  2. Email reminder will be added to job queue
  3. The update workflow can be tested from here by selecting the "Make a Correction" button

Screenshots

Reminder Email

@gabeparra01
Copy link
Contributor Author

The failing spec seems unrelated to the code changes in this PR. I ran the spec locally and it succeeded:

image

@dorner dorner requested review from cielf and dorner December 20, 2024 00:00
@dorner
Copy link
Collaborator

dorner commented Dec 20, 2024

@gabeparra01 can you add a spec for this behavior? Preferably for both create and update?

@gabeparra01
Copy link
Contributor Author

@gabeparra01 can you add a spec for this behavior? Preferably for both create and update?

@dorner I'm glad you asked! I noticed another issue that needed to be fixed while writing the tests: Only schedule reminder email if box is checked

I added the specs in this commit: Added specs for distribution reminder emails

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@dorner dorner merged commit fc1e7b4 into rubyforgood:main Dec 23, 2024
11 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2025

@gabeparra01: Your PR Resolves #4857 is part of today's Human Essentials production release: 2025.01.05.
Thank you very much for your contribution!

@gabeparra01 gabeparra01 deleted the 4857-fix-reminders-flag branch January 10, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the reminders flag on the distribution work properly

2 participants