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

Multiple channels marking as sent multiple times #30

Open
antonivanopoulos opened this issue Nov 20, 2015 · 0 comments
Open

Multiple channels marking as sent multiple times #30

antonivanopoulos opened this issue Nov 20, 2015 · 0 comments
Labels

Comments

@antonivanopoulos
Copy link
Contributor

self.channels.each do |channel_name, options|
  if(options[:aggregate_per] == false)
    self.mark_as_sent!
    self.class.delay.deliver_notification_channel(self.id, channel_name)
else
…

This is part of the current implementation of the #deliver method on the base notification class (https://github.com/Papercloud/notify_user/blob/master/app/models/notify_user/base_notification.rb#L294). The issue here is that the AASM is throwing an invalid transition error because when one channel marks the notification as sent, subsequent channels will also try to mark it as sent.

Also has the added issue that aggregated notifications call mark_as_pending_as_aggregation_parent!; so you can't currently have one channel that aggregates, and one that doesn't. But this is perhaps a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant