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

Allow sentinel transitions to run synchronously against incoming SMS messages #4857

Closed
SCdF opened this issue Sep 26, 2018 · 4 comments
Closed
Assignees
Labels
Priority: 2 - Medium Normal priority Sentinel Affects the Sentinel service SMS Affects sending or receiving of messages Type: Performance Make something faster
Projects

Comments

@SCdF
Copy link
Contributor

SCdF commented Sep 26, 2018

Currently the flow for an SMS with a default response is slower than it could be:

  • CHW sends an SMS to the gateway, which takes it and puts it in it's queue
  • Gateway wakes up every minute and sends the SMS to Medic, gets any existing SMS to send back and closes the connection
  • Sentinel asynchronously updates the SMS report to add a default response
  • 1 minute later Gateway talks to Medic, finds this response and sends it out.

We should look into extracting sentinel into a shared lib that we can run in realtime when receiving new SMS. This means we will any resulting SMS as part of the same request.

Combined with #4858 this could greatly increase the responsiveness of SMS.

@garethbowen garethbowen added SMS Affects sending or receiving of messages and removed medic-gateway labels Nov 20, 2018
@garethbowen garethbowen added this to Todo in 3.5.0 via automation Nov 27, 2018
@garethbowen garethbowen added Status: 1 - Triaged Type: Performance Make something faster Sentinel Affects the Sentinel service Priority: 2 - Medium Normal priority and removed Status: 1 - Triaged labels Nov 27, 2018
@dianabarsan dianabarsan self-assigned this Jan 7, 2019
@dianabarsan dianabarsan moved this from To do to In progress in 3.5.0 Jan 7, 2019
dianabarsan added a commit that referenced this issue Feb 5, 2019
@dianabarsan
Copy link
Member

dianabarsan commented Feb 7, 2019

Being such a heap of work, I decided to break this up into multiple pieces:

@dianabarsan
Copy link
Member

Ready for AT on 4857-detached-sentinel-bis branch.

@ngaruko ngaruko self-assigned this Mar 26, 2019
@ngaruko
Copy link
Contributor

ngaruko commented Apr 23, 2019

LGTM.
Tested by sending a message via the admin portal and /api/sms and quickly moving to the app message tab to see the result. Messages are sent instantly.
Back to you @dianabarsan for merging!

@dianabarsan
Copy link
Member

There is one new library to be published and updates to be made so the branch is using the new library. Will merge once I get to a good connection.

dianabarsan added a commit that referenced this issue May 2, 2019
Pulls sentinel transitions out into a shared library
Enables usage of new shared library @medic/transitions in Sentinel and API.
API sms and records endpoints now run transitions over docs before saving.

#4857
dianabarsan added a commit that referenced this issue May 3, 2019
Pulls sentinel transitions out into a shared library
Enables usage of new shared library @medic/transitions in Sentinel and API.
API sms and records endpoints now run transitions over docs before saving.

#4857
@dianabarsan dianabarsan moved this from In AT to Done in 3.5.0 May 9, 2019
abbyad pushed a commit that referenced this issue May 10, 2019
Pulls sentinel transitions out into a shared library
Enables usage of new shared library @medic/transitions in Sentinel and API.
API sms and records endpoints now run transitions over docs before saving.

#4857
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 - Medium Normal priority Sentinel Affects the Sentinel service SMS Affects sending or receiving of messages Type: Performance Make something faster
Projects
No open projects
3.5.0
  
Done
Development

No branches or pull requests

4 participants