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

FEATURE: keeps going invitees for recurring events #632

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Conversation

jjaffeux
Copy link
Contributor

Prior to this fix when computing the next event date we were resetting the status of every invitees. The status will now only be reset for non going users.

Prior to this fix when computing the next event date we were resetting the status of every invitees. The status will now only be reset for non going users.
if !next_dates[:rescheduled]
notify_invitees!
notify_missing_invitees!
end

publish_update!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really related, but I think we should publish the update once we are done, and not randomly in the middle of the sequence

@@ -53,12 +53,14 @@ def set_next_date
end
end

publish_update!
invitees.update_all(status: nil, notified: false)
invitees.where.not(status: Invitee.statuses[:going]).update_all(status: nil, notified: false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change. Instead of selectioning every invitees we filter out the going invitees

Copy link
Member

@nbianca nbianca Oct 24, 2024

Choose a reason for hiding this comment

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

I am wondering if there should be "going to this event" and "going to this and all future events" buttons like other calendars have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe, but for now we will assume it's by default "going to this and all future events"

@@ -41,11 +41,6 @@ def upsert_topic_custom_field
end
end

after_commit :reset_invitees_status, on: %i[create]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the only place where we call event_dates.create and trigger this hook, is in the event hook and we manually call the set_date which has the same behavior we just have modified in this commit. It was essentially doing two times the same work.

@jjaffeux jjaffeux merged commit 557d00b into main Oct 25, 2024
5 checks passed
@jjaffeux jjaffeux deleted the wip-recurring branch October 25, 2024 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants