Skip to content

Process invalid push notifications #433

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

Merged
merged 3 commits into from
Sep 25, 2018

Conversation

mllocs
Copy link
Collaborator

@mllocs mllocs commented Sep 24, 2018

In order to send a PushNotification, the model must have non blank title and body. While testing the PushNotification creator we created some invalid models in production (and probably other envs).

Here I'm adding the validations and a migration to mark those invalid notifications as processed.

@mllocs
Copy link
Collaborator Author

mllocs commented Sep 24, 2018

unless push_notification.valid?
now = Time.now.utc
push_notification.update_columns(processed_at: now, updated_at: now)
puts "Updating invalid PushNotification ##{push_notification.id}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Rails logger?

@enricostano
Copy link
Contributor

Tested in staging 🍏

@enricostano enricostano merged commit cd18f3e into develop Sep 25, 2018
@enricostano enricostano deleted the fix/invalid-push-notifications branch September 25, 2018 11:00
@enricostano enricostano mentioned this pull request Sep 25, 2018
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.

2 participants