Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Group Attendance Reminder Job (v15) fails when there's more than one group leader #5462

Closed
1 task done
leahjennings opened this issue Jun 1, 2023 · 2 comments
Closed
1 task done
Labels
Fixed in v15.2 Fixed in v16.0 Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@leahjennings
Copy link
Collaborator

leahjennings commented Jun 1, 2023

Please go through all the tasks below

  • Check this box only after you have successfully completed both the above tasks

Please provide a brief description of the problem. Please do not forget to attach the relevant screenshots from your side.

When a group type is configured to send attendance reminders using the new Send Group Attendance Reminder job available in v15 AND the group has more than one leader, the job fails with an exception. The exception is as follows:
image

Looking at the code behind that job, it appears like the code in the job that creates + inserts the attendance occurrence runs for each group leader, not just for each group. The exception is:
Cannot insert duplicate key row in object 'dbo.AttendanceOccurrence' with unique index 'IX_GroupId_LocationID_ScheduleID_Date'. The duplicate key value is (112, <NULL>, 16, 2023-06-01). The statement has been terminated.

Expected Behavior

I would expect that the new Send Group Attendance Reminder job would be able to handle sending reminders to groups with more than one leader.

Actual Behavior

If a group has more than one group leader, the job will throw an exception because it's trying to create the occurrence again.

Steps to Reproduce

  • Go to the demo server (running v15)
  • Go to Admin Tools > General Settings and click on Group Types
  • Click on the Group Type Small Group
  • Expand Attendance / Check-in
    • Check Send Attendance Reminder
    • Set an Attendance Reminder Communication Template
    • Set an Attendance Reminder Start Offset Minutes
    • image
    • Save the changes made to the Group Type

This next step is required, otherwise the job will throw an error that there's no email transport configured

  • Go to Admin Tools > Communications and click on Communication Transports
  • Click on SMTP to open its settings
  • Change the server to smtp.freesmtpservers.com
image
  • Go to People > Group Viewer

  • Expand Section A and click on Alisha Marble’s Group

  • Edit the group and adjust the meeting date/time to be within the offset configured above when you run the service job

  • Save the group

  • Go to Admin Tools > System Settings, and click on Jobs Administration

  • Manually run the Send Group Attendance Reminders job

  • Notice the exception

image image

Rock Version

Rock McKinley 15.0 (1.15.0.16)

Client Culture Setting

en-US

@sparkdevnetwork-service sparkdevnetwork-service added the Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. label Jun 2, 2023
@sparkdevnetwork-service sparkdevnetwork-service added the Type: Bug Confirmed bugs or reports that are very likely to be bugs. label Jun 29, 2023
PraveenMathew92 added a commit that referenced this issue Jun 30, 2023
…for groups with multiple leaders. (Fixes #5462). (Fixes #5488)
@zackdutra
Copy link

zackdutra commented Sep 26, 2023

@leahjennings, @PraveenMathew92, or @chead4 -we're in 15.1 still. Does this job send to at least the first group leader or does it just fail for both? I'm seeing the exceptions but not sure if it's failing completely or just on the second leader. Or does it send to both correctly and just is failing because of trying to create a second occurrence? I'm not clear on what exactly is failing.

@austinspooner
Copy link

@zackdutra for us, it failed for some groups and for others caused them to be stuck in a loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in v15.2 Fixed in v16.0 Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

6 participants