Giter Site home page Giter Site logo

Comments (10)

newtewt avatar newtewt commented on July 27, 2024 1

@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.

dianabarsan avatar dianabarsan commented on July 27, 2024

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
gateway-highlight

on master
gateway2-highlight

from cht-gateway.

benkags avatar benkags commented on July 27, 2024

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.

garethbowen avatar garethbowen commented on July 27, 2024

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.

garethbowen avatar garethbowen commented on July 27, 2024

Moved to 3.11.0 to align with other gateway work.

from cht-gateway.

latin-panda avatar latin-panda commented on July 27, 2024

Research:
Android Oreo (8+) added restrictions to background process to optimise memory usage. Must intents should be explicit.

In this repository means:

  1. Remove the custom intent actions from the manifest, since they aren't going to be implicit anymore.
  2. Create the Pending Intent and specify the context where it's associated to..
  3. 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.

latin-panda avatar latin-panda commented on July 27, 2024

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.

latin-panda avatar latin-panda commented on July 27, 2024

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.

newtewt avatar newtewt commented on July 27, 2024

I believe this is ready to be merged after our group session we had for testing. Any objections @brad1905 @ngaruko ?

from cht-gateway.

brad1905 avatar brad1905 commented on July 27, 2024

Agreed, no objections

from cht-gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.