Tweak gateway SMS forwarding so you can define how long we wait to send SMS
SCdF opened this issue · 10 comments
Currently, Gateway stores incoming SMS and only forwards them to Medic once a minute, when it polls.
We should add a flag so that we can, if we want, forward SMS to Medic as soon as we receive them. This works great with the existing poll interval configuration.
Combined with #137 this could greatly increase the responsiveness of SMS.
NB: we decided to not add a flag, and instead just make it required. This made the code simpler, and if it causes problems in the future we can expose it as a config flag / parameter.
I think my comment about "debounce" delay made this overly confusing.
What I really meant is: we should have the default configuration send SMS immediately, but also probably allow that to be configurable. I presume that at the time I found a configuration parameter that defined how long we wait, and so probably we just need to see if this is set to zero and count that as "immediately". I haven't looked into this code in a long time though, it's worth investigating it's current state more.
Bumped to 3.8 as discussed in the product meeting. Gateway can be released as soon as this is ready.
@garethbowen finally managed to wrestle Gateway tests to submission. Please take a look :-)
Ready for AT on 138_send_sms_straight_away
- NB that it's branched from 137_loop_gateway_forwarding
so AT that one first!
Assigning myself for AT.
This requires more work before merge. As gateway is on a separate release schedule this doesn't need to block 3.8.0 so I'm moving it to 3.9.0.
Ready for AT again:
- When sending SMS into gateway it should tend to send those updates to Webapp in real time. This is tricky because it requires that android let's the app wake at all. However, you can follow the logs with logcat and at least you'll tell if it errors in any way
Assigning myself for AT.
This looks like it works really well!
I'm receiving SMS replies from gateway ~2-3 seconds after sending a report (using different telecoms).
I did, however, notice that after I sent a bunch of messages, gateway had delays in actually receiving them. I think my messages were being deprioritized by either telecom. In those cases, it took minutes to get a reply.
This passes my limited AT capabilities!
Merged.