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

Fix duplicate notifications being possible after poll expiration #17697

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Mar 3, 2022

No description provided.

@Gargron Gargron added the bug Something isn't working label Mar 3, 2022
@Gargron Gargron force-pushed the fix-notificaton-duplicates branch from b6d985c to ee406e3 Compare March 3, 2022 23:33
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

I think it makes more sense to move the

    # For most notification types, only one notification should exist, and the older one is
    # preferred. For updates, such as when a status is edited, the new notification
    # should replace the previous ones.
    if type == 'update'
      Notification.where(account: receiver, activity: activity, type: 'update').in_batches.delete_all
    elsif Notification.where(account: receiver, activity: activity, type: type).any?
      return
    end

from LocalNotificationWorker to NotifyService

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

whatever

@Gargron Gargron merged commit 2ea754b into main Mar 4, 2022
@Gargron Gargron deleted the fix-notificaton-duplicates branch March 4, 2022 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants