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

Notifications are never queued #953

Closed
rjmackay opened this issue Feb 24, 2016 · 16 comments
Closed

Notifications are never queued #953

rjmackay opened this issue Feb 24, 2016 · 16 comments
Assignees
Labels

Comments

@rjmackay
Copy link
Contributor

  1. Create a saved search for post within 100km of Auckland
  2. Set up notifications: email + SMS
  3. Add a new post with location Auckland.
  4. Confirm post shows up in saved search.
    Expected: messages queued to send
    Actual: No messages are ever queued
@rjmackay
Copy link
Contributor Author

@jasonmule can you look into this? I haven't tried to reproduce locally yet.
This is a problem for the KRC deployment so needs to get fixed asap

@jasonmule
Copy link
Contributor

I tried to reproduced this locally and it's possible that this fails because of the following reasons:

  1. The user has not subscribed to notifications. When the user adds a notification for the first time, it's probably a good idea to direct them to manage their notifications and add at least one contact.
  2. The post has not been published. At the moment we only send out notifications for published posts.

The following commands queue notifications for saved searches:

1 . Find posts from saved searches

bin/ushahidi savedsearch

2 . Queue notifications

bin/ushahidi notification queue

@snilsmitchell
Copy link

When I tried at krcs.ushahidi.io, I checked that I was subscribed to notifications before publishing a post, and made sure that the post had been published (and all post steps completed). The notification was still not sent.

@jasonmule
Copy link
Contributor

Thanks @sebm90. We should probably still remind you to add a contact if you don't have one when you subscribe.

@snilsmitchell
Copy link

@jasonmule Could you explain what adding a contact involves? Aren't my own contact details (my email, which is already in the system) enough? Does this need to be a different person?

@jasonmule
Copy link
Contributor

@rjmackay Did you run bin/ushahidi savedsearch ?

@jasonmule
Copy link
Contributor

@sebm90 Could you go to Manage notifications and check that your email contact is turned on to receive notifications?

@ushbot
Copy link
Collaborator

ushbot commented Feb 24, 2016

@jasonmule I was testing on staging. I haven't tried to reproduce locally yet. I'll do that today.

The post has not been published. At the moment we only send out notifications for published posts.

That might have been my issue.. though I thought I tested both. I definitely enabled notifications in the UI.

@rjmackay
Copy link
Contributor Author

oops that was me not a bot.

@snilsmitchell
Copy link

@jasonmule My email contact is turned on and was turned on when I tested notifications:
image

@rjmackay
Copy link
Contributor Author

Just reproduced the issue locally for myself.
bin/ushahidi savedsearch yields " 2 posts were added "
But then bin/ushahidi notifications queue says "0 messages queued for sending"

@rjmackay
Copy link
Contributor Author

Looking in the DB. posts_sets is being populated for the posts I added, but only for the default sets: All post, and published posts. Its not picking up the saved search for post near Auckland that I added.

@rjmackay
Copy link
Contributor Author

Looks like the saved search criteria includes some values which get filtered out by the client, but don't work when used directly on the server. ie. form = 'none'
We'll need to fix our handling for those on both client and server I think

@rjmackay rjmackay added this to the Sprint 29 Feb milestone Feb 29, 2016
@jasonmule
Copy link
Contributor

@rjmackay When the saved searches were added, was there a contact turned on to receive notifications? Could you clarify the bit about only default sets?

@jasonmule
Copy link
Contributor

So the savedsearch task uses the filters saved with the saved search. The only way I was able to reproduce the issue where 0 messages were queued is when there is no contact subscribed to the queued posts.

rjmackay added a commit that referenced this issue Mar 4, 2016
SavedSearch console command was using a single SearchData - this meant values from the previous search were left in the state.

Updated to use the DataFactory and get a fresh data object each time.

Refs #953
@rjmackay
Copy link
Contributor Author

rjmackay commented Mar 4, 2016

Looks like this was dependent on state - filters from previous searches leaked into the next one.

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

5 participants