Comments (10)
@latin-panda We have tested this using the branch and built to my android 11 device. Seeing the messages go from UNSENT -> PENDING ->SENT. The text then sends to my phone.
The struggle we have is that none of QA's have a less than android 8 phone with service and I feel we should probably involve the tech leads to use a "beta" build of the gateway app to see if any issues are found with a prod instance.
from cht-gateway.
Just tested on another device where the SMSs do get the correct DELIVERED state:
key | value(s) |
---|---|
medic-gateway version | master |
device make | HTC |
device model | ONE - Android 5 |
can the problem be recreated on this device? | yes, when sending multiple. no when sending one. |
I/MedicGateway(14790): Sending 1 SMSs...
D/MedicGateway(14790): medic.gateway.alert.SettingsStore :: loading for context: medic.gateway.alert.MessageListsActivity@d584864
D/MedicGateway(14790): medic.gateway.alert.Settings :: Settings() webappUrl=https://gateway:****@a03a65d2.eu.ngrok.io/api/sms
D/MedicGateway(14790): medic.gateway.alert.SettingsStore :: loading for context: medic.gateway.alert.MessageListsActivity@d584864
D/MedicGateway(14790): medic.gateway.alert.Settings :: Settings() webappUrl=https://gateway:****@a03a65d2.eu.ngrok.io/api/sms
D/MedicGateway(14790): medic.gateway.alert.SmsSender :: sendUnsentSmses() :: attempting to send WoMessage@2e178df1-359a-48da-9399-95501d09ea17-UNSENT
I/MedicGateway(14790): sendSms() :: [*******] 'ing rest'
D/MedicGateway(14790): medic.gateway.alert.Db :: updateStatus() :: WoMessage@2e178df1-359a-48da-9399-95501d09ea17-UNSENT :: UNSENT -> PENDING (null)
I/MedicGateway(14790): IntentProcessor.onReceive() :: medic.gateway.alert.SENDING_REPORT
I/MedicGateway(14790): Received sending report for message 2e178df1-359a-48da-9399-95501d09ea17 part -1.
D/MedicGateway(14790): medic.gateway.alert.Db :: getWoMessages() :: item fetch count: 1
D/MedicGateway(14790): medic.gateway.alert.Db :: updateStatus() :: WoMessage@2e178df1-359a-48da-9399-95501d09ea17-PENDING :: PENDING -> SENT (null)
I/MedicGateway(14790): IntentProcessor.onReceive() :: medic.gateway.alert.DELIVERY_REPORT
I/MedicGateway(14790): Received delivery report for message 2e178df1-359a-48da-9399-95501d09ea17 part -1.
D/MedicGateway(14790): medic.gateway.alert.Db :: getWoMessages() :: item fetch count: 1
I/MedicGateway(14790): Delivery status: 0x0
D/MedicGateway(14790): medic.gateway.alert.Db :: updateStatus() :: WoMessage@2e178df1-359a-48da-9399-95501d09ea17-SENT :: null -> DELIVERED (null)
I am seeing the same behavior, though, of delivered that SMSs have PENDING statuses when the gateway sends many messages in quick succession. Retrying an individual one does get it the correct status along with sending it again.
on 137_loop_gateway_forwarding
from cht-gateway.
This is happening in Samsung A50 and Infinix Hot 8 devices when using v1.7.4. Messages' status never changes to 'Delivered' or 'Sent'.
v1.5.0 apk shared by @henokgetachew here does not have this problem.
from cht-gateway.
Deferring this to 3.10.0 so we can get 3.9.0 out as soon as possible - please contact me if you consider this more urgent.
The workaround as I understand it is to use an older android or an older apk.
This can be developed and released separately to the rest of cht-core.
from cht-gateway.
Moved to 3.11.0 to align with other gateway work.
from cht-gateway.
Research:
Android Oreo (8+) added restrictions to background process to optimise memory usage. Must intents should be explicit.
In this repository means:
- Remove the custom intent actions from the manifest, since they aren't going to be implicit anymore.
- Create the Pending Intent and specify the context where it's associated to..
- Set the custom action type (from # 1) in the Pending Intent object.
More info here:
Broadcast limitations
Background optimizations
Possible fix
https://commonsware.com/blog/2017/04/11/android-o-implicit-broadcast-ban.html
from cht-gateway.
Research:
Regarding the second issue: Where sending multiple SMS on PENDING status, only one gets updated to SENT.
It could be because we are creating one Pending Intent's broadcast per SMS, but each has the same value for requestCode
, overriding the broadcast. The requestCode
and the intent
are used later to identify the fired broadcast with its associated SMS.
The requestCode
is type integer, which limit our capacity for assigning unique values without going too complex. One approach is to use the SMS index from the List, then it'll process 1 list at the time or use the message's hashCode.
from cht-gateway.
Awesome, thanks @newtewt ! I support your idea of involving the tech leads to use the "beta", the Gateway is tricky to test with so many differences between phones and environments :)
from cht-gateway.
I believe this is ready to be merged after our group session we had for testing. Any objections @brad1905 @ngaruko ?
from cht-gateway.
Agreed, no objections
from cht-gateway.
Related Issues (20)
- Refactor WakefulService and friends to reuse code more HOT 1
- Server-side Monitoring
- Document and solve upgrade path issues HOT 3
- On newer android devices the Help Me Change button doesn't work HOT 7
- Gateway requires you to refresh to see message state changes
- CMMB Kitui Gateway App Troubleshooting HOT 1
- Icon has changed
- phone theme is ignored
- Improve ability to debug Gateway issues in production
- Upgrade CI to use Github Actions HOT 2
- Enable Polling fails with no clear message to user HOT 2
- Version 1.8.1 does not work properly on android 10 HOT 1
- Update grade version and relevant dependencies HOT 3
- Upgrade target sdk to 30 and associated changes HOT 1
- Changes in upcomming Android 12 may break the SMS capabilities
- Passwords for Medic Gateway cannot use special characters.
- disable sms report HOT 1
- Sync cht-gateway logs to cloud
- Use AuthSession cookie for login instead of basic auth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cht-gateway.