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
Mark messages as received-by-gateway so they are not included in the next response #142
Comments
@estellecomment It look like you've done most of the work for this. Is it in progress, or do you want me to finish it off? |
I haven't given up on it yet :) |
@alxndrsn Can you review? |
PR test failures are things like this:
The espresso tests intermittently fail on Travis with errors like this. I'll re-run and see if they pass the second time. |
In current protocol, steps 2 and 4 pass on the same WO message to gateway, which is useless : https://github.com/medic/medic-docs/blob/e4483cbae3b619f1db8f1990f43cd25905e7b09d/user/message-states.md This change does make sure that WO message receipt by gateway is passed back to webapp, so that webapp doesn't send twice. See the medic-docs change for clarity : medic/medic-docs@a7be4b0
@alxndrsn What's the status of this? Did it fail AT? |
nah, I merged it but @alxndrsn hadn't reviewed it so reverted it.
I have higher priority stuff that keeps happening, but it's still on my list. |
@alxndrsn Would you mind finishing this off while @estellecomment is away? |
I didn't have time to refamiliarise myself with the original ticket, and the information about motivation here seems sparse. I would like to fully consider whether this is useful, in line with discussions about the protocol and recent work on the server-side by @SCdF. But if we do want to achieve this, PR at #113 |
Delaying as this is a performance improvement only. |
SummaryThe issue is when API send to Gateway a message (sms), this message was being saved as "not needing forwarding", so its status wasn't updated as "received by gateway" and API might try to send it again to Gateway. The fix is: It's important to note that API <-> Gateway communicates in intervals of time, every 2 or 5 minutes. |
@latin-panda I think this is ready to go. I've pulled the sqlite database and see the message is marked with
|
Ticket: #142 * This commit will refactor to also notify API of any status change in the sms.
Ticket: #142 This commit will update needForwarded flag to send messages statuses to API
@latin-panda Can this issue be closed now? |
Hi @garethbowen, yes, it's in "done" status and code was merged :) |
From medic/cht-core#3073 :
Modify medic-gateway to call medic-api and change the status of received messages to received-by-gateway after they have been successfully written to the database. This will stop them being sent again next query and reduce the bandwidth requirements.
This will avoid step 4 in the current protocol
To do it, have gateway set the
needs forwarding
flag totrue
when storing a new message in DB.The text was updated successfully, but these errors were encountered: