Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Media upload/download lost connection failed won't call onError #111

Closed
polivmi1 opened this issue Nov 5, 2019 · 2 comments
Closed

Media upload/download lost connection failed won't call onError #111

polivmi1 opened this issue Nov 5, 2019 · 2 comments
Labels
disposition:filed-internally This issue has a Twilio-internal tracking ticket sdk-version:4.x

Comments

@polivmi1
Copy link

polivmi1 commented Nov 5, 2019

Description

When uploading a media and connection is cut out, the onError callback of sendMessage is never called. It is called correctly if upload haven't started yet and there is no connection.

For Download, it is not called neither if there is no connection in the beginning or during the process. But SDK message says, it should call the onError listener in both cases (it doesn't):
D/TWC: 2145462640 | Message.Media(native) | media download failed. Calling java listener.

When there is no connection during upload, the media still sometimes uploads if reconnected quickly, if not, I can see the retry, but that disappears after reconnecting and isn't retried.

Expected Behavior

onError should be called in all cases, or media should retry and finish upload/download and call onComplete/ onSuccess

Actual Behavior

onError isn't called in 3 out of 4 cases as mentioned in description

Reproduces how Often

100%

Logs

Please collect logs as described here. Full unedited logs help reproduce and fix issues faster.


2019-11-05 15:23:01.409 14352-15004/com.test E/TWC:        -2139117200 |     19 | Websocket | reportConnectFail read: Software caused connection abort, 12
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:         2134063472 |        |  | Request completed: 0xa7a3e840, queue size=1
2019-11-05 15:23:01.409 14352-15004/com.test I/TWC:         2134063472 | Media.Client | Request failed. onResponseRead: Software caused connection abort
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |      4 | Twilsock.Client | onTransportDisconnected in state Connected
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:         2134063472 | IPM | [MEbecb246439127cde1306fcaf36e1be12] message: got media metadata 1
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Connected
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:         2134063472 | Message.Media(native) | media download failed. Calling java listener.
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |      5 | Twilsock.ClientImpl | notifyAboutDisconnecting: Transport layer notified about disconnect
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |     24 | RegTwilsockSession | onStateChanged ctxId: 9f4a6ad5fe534c399e30b85e81cdc89d - state: Unregistered, cur state: Registered
2019-11-05 15:23:01.409 14352-15004/com.test I/TWC:        -2139117200 |     11 | State.Connected | Leaving state: Connected
2019-11-05 15:23:01.409 14352-15004/com.test I/TWC:        -2139117200 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |      5 | Twilsock.ClientImpl | setRetryTimeout: 2000
2019-11-05 15:23:01.409 14352-15004/com.test D/TWC:        -2139117200 |      5 | Twilsock.ClientImpl | startRetryTimer 2000
2019-11-05 15:23:01.410 14352-15004/com.test D/TWC:        -2139117200 |      5 | Twilsock.ClientImpl | setRetryTimeout: 4000
2019-11-05 15:23:01.410 14352-15004/com.test I/TWC:         2134063472 |     21 | NotificationClient | onTwilsockDisconnected: Transport layer notified about disconnect
2019-11-05 15:23:01.410 14352-15004/com.test I/TWC:         2134063472 |     21 | NotificationClient | updateAggregatedTransportState, old state: 1, new state 0
2019-11-05 15:23:01.410 14352-15004/com.test D/TWC:         2134063472 | TransportStateObserver | Transport is trying to connect and register or trying to recover for channel type twilsock
2019-11-05 15:23:01.410 14352-15004/com.test D/TWC:         2134063472 | ChatClientListener(native) | onTransportStateChanged
2019-11-05 15:23:01.410 14352-15004/com.test I/TWC:         2134063472 |     28 | TSNotificationRouter | Transport state changed. Is enabled: 0
2019-11-05 15:23:01.410 14352-15004/com.test I/TWC:         2134063472 |     21 | NotificationClient | onRegStateChanged: twilsock: 'internal twilsock address', state: Unregistered
2019-11-05 15:23:01.410 14352-15004/com.test I/TWC:         2134063472 |     21 | NotificationClient | updateAggregatedTransportState, old state: 0, new state 0
2019-11-05 15:23:01.429 14352-15004/com.test D/TWC:        -1420901208 | IPM | message: [api] get member: sid = MB1f480dd0f2a342c9a8f418494d25825c; author = SRV92s7osB3DDl5WauNR81*Q
2019-11-05 15:23:01.429 14352-15004/com.test I/TWC:        -1420901208 | IPM | [DYdcR] channel: [api] get members
2019-11-05 15:23:01.429 14352-15004/com.test I/TWC:        -1420901208 | IPM | [DYdcR] members: [api] get member by sid MB1f480dd0f2a342c9a8f418494d25825c
2019-11-05 15:23:01.430 14352-15004/com.test D/TWC:        -1420901208 | EntityCache | Returning Java object from cache
2019-11-05 15:23:01.453 14352-15004/com.test D/TWC:        -1420901208 | IPM | message: [api] get member: sid = MB1f480dd0f2a342c9a8f418494d25825c; author = SRV92s7osB3DDl5WauNR81*Q
2019-11-05 15:23:01.453 14352-15004/com.test I/TWC:        -1420901208 | IPM | [DYdcR] channel: [api] get members
2019-11-05 15:23:01.453 14352-15004/com.test I/TWC:        -1420901208 | IPM | [DYdcR] members: [api] get member by sid MB1f480dd0f2a342c9a8f418494d25825c
2019-11-05 15:23:01.453 14352-15004/com.test D/TWC:        -1420901208 | EntityCache | Returning Java object from cache
2019-11-05 15:23:02.025 14352-15004/com.test I/TWC:         2146498928 | IPM | [7nijm] consumption: StateConsumptionStateQueue->StateConsumptionStateReady
2019-11-05 15:23:03.413 14352-15004/com.test D/TWC:         2146498928 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:23:03.413 14352-15004/com.test D/TWC:         2146498928 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:23:03.413 14352-15004/com.test D/TWC:         2146498928 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:23:03.413 14352-15004/com.test I/TWC:         2146498928 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:23:03.416 14352-15004/com.test I/TWC:         2146498928 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:23:03.416 14352-15004/com.test D/TWC:         2146498928 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:23:03.416 14352-15004/com.test D/TWC:         2137172336 |     19 | Websocket | Connecting...
2019-11-05 15:23:03.432 14352-15004/com.test E/TWC:         2143390064 |     19 | Websocket | reportConnectFail Could not resolve host tsock.us1.twilio.com: Host not found (authoritative), 12
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2143390064 |      4 | Twilsock.Client | onTransportDisconnected in state Transport connecting
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2135099760 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Transport connecting
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2135099760 |      5 | Twilsock.ClientImpl | stopTransportConnectingTimer
2019-11-05 15:23:03.432 14352-15004/com.test I/TWC:         2135099760 |      9 | State.TransportConnecting | Leaving state: Transport connecting
2019-11-05 15:23:03.432 14352-15004/com.test I/TWC:         2135099760 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2135099760 |      5 | Twilsock.ClientImpl | setRetryTimeout: 4000
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2135099760 |      5 | Twilsock.ClientImpl | startRetryTimer 4000
2019-11-05 15:23:03.432 14352-15004/com.test D/TWC:         2135099760 |      5 | Twilsock.ClientImpl | setRetryTimeout: 8000
2019-11-05 15:23:07.450 14352-15004/com.test D/TWC:         2134063472 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:23:07.450 14352-15004/com.test D/TWC:         2134063472 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:23:07.450 14352-15004/com.test D/TWC:         2134063472 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:23:07.451 14352-15004/com.test I/TWC:         2134063472 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:23:07.451 14352-15004/com.test D/TWC:         2144426352 |     19 | Websocket | Connecting...
2019-11-05 15:23:07.451 14352-15004/com.test I/TWC:         2134063472 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:23:07.451 14352-15004/com.test D/TWC:         2134063472 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:23:07.471 14352-15004/com.test E/TWC:         2140281200 |     19 | Websocket | reportConnectFail Could not resolve host tsock.us1.twilio.com: Host not found (authoritative), 12
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      4 | Twilsock.Client | onTransportDisconnected in state Transport connecting
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Transport connecting
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      5 | Twilsock.ClientImpl | stopTransportConnectingTimer
2019-11-05 15:23:07.471 14352-15004/com.test I/TWC:         2140281200 |      9 | State.TransportConnecting | Leaving state: Transport connecting
2019-11-05 15:23:07.471 14352-15004/com.test I/TWC:         2140281200 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      5 | Twilsock.ClientImpl | setRetryTimeout: 8000
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      5 | Twilsock.ClientImpl | startRetryTimer 8000
2019-11-05 15:23:07.471 14352-15004/com.test D/TWC:         2140281200 |      5 | Twilsock.ClientImpl | setRetryTimeout: 16000
2019-11-05 15:23:15.487 14352-15004/com.test D/TWC:         2143390064 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:23:15.487 14352-15004/com.test D/TWC:         2143390064 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:23:15.487 14352-15004/com.test D/TWC:         2143390064 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:23:15.487 14352-15004/com.test I/TWC:         2143390064 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:23:15.487 14352-15004/com.test I/TWC:         2143390064 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:23:15.487 14352-15004/com.test D/TWC:         2143390064 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:23:15.487 14352-15004/com.test D/TWC:         2142353776 |     19 | Websocket | Connecting...
2019-11-05 15:23:15.508 14352-15004/com.test E/TWC:         2135099760 |     19 | Websocket | reportConnectFail Could not resolve host tsock.us1.twilio.com: Host not found (authoritative), 12
2019-11-05 15:23:15.508 14352-15004/com.test D/TWC:         2135099760 |      4 | Twilsock.Client | onTransportDisconnected in state Transport connecting
2019-11-05 15:23:15.508 14352-15004/com.test D/TWC:         2144426352 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Transport connecting
2019-11-05 15:23:15.508 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | stopTransportConnectingTimer
2019-11-05 15:23:15.509 14352-15004/com.test I/TWC:         2144426352 |      9 | State.TransportConnecting | Leaving state: Transport connecting
2019-11-05 15:23:15.509 14352-15004/com.test I/TWC:         2144426352 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:23:15.509 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | setRetryTimeout: 16000
2019-11-05 15:23:15.509 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | startRetryTimer 16000
2019-11-05 15:23:15.509 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | setRetryTimeout: 32000
2019-11-05 15:23:31.579 14352-15004/com.test D/TWC:         2141317488 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:23:31.579 14352-15004/com.test D/TWC:         2141317488 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:23:31.579 14352-15004/com.test D/TWC:         2141317488 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:23:31.579 14352-15004/com.test I/TWC:         2141317488 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:23:31.579 14352-15004/com.test I/TWC:         2141317488 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:23:31.581 14352-15004/com.test D/TWC:         2141317488 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:23:31.581 14352-15004/com.test D/TWC:         2139244912 |     19 | Websocket | Connecting...
2019-11-05 15:23:31.602 14352-15004/com.test E/TWC:         2145462640 |     19 | Websocket | reportConnectFail Could not resolve host tsock.us1.twilio.com: Host not found (authoritative), 12
2019-11-05 15:23:31.602 14352-15004/com.test D/TWC:         2145462640 |      4 | Twilsock.Client | onTransportDisconnected in state Transport connecting
2019-11-05 15:23:31.602 14352-15004/com.test D/TWC:         2145462640 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Transport connecting
2019-11-05 15:23:31.603 14352-15004/com.test D/TWC:         2145462640 |      5 | Twilsock.ClientImpl | stopTransportConnectingTimer
2019-11-05 15:23:31.603 14352-15004/com.test I/TWC:         2145462640 |      9 | State.TransportConnecting | Leaving state: Transport connecting
2019-11-05 15:23:31.603 14352-15004/com.test I/TWC:         2145462640 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:23:31.603 14352-15004/com.test D/TWC:         2145462640 |      5 | Twilsock.ClientImpl | setRetryTimeout: 32000
2019-11-05 15:23:31.603 14352-15004/com.test D/TWC:         2145462640 |      5 | Twilsock.ClientImpl | startRetryTimer 32000
2019-11-05 15:23:31.603 14352-15004/com.test D/TWC:         2145462640 |      5 | Twilsock.ClientImpl | setRetryTimeout: 64000
2019-11-05 15:24:03.603 14352-15004/com.test D/TWC:         2144426352 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:24:03.603 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:24:03.603 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:24:03.604 14352-15004/com.test I/TWC:         2144426352 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:24:03.604 14352-15004/com.test I/TWC:         2144426352 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:24:03.604 14352-15004/com.test D/TWC:         2144426352 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:24:03.604 14352-15004/com.test D/TWC:         2140281200 |     19 | Websocket | Connecting...
2019-11-05 15:24:03.624 14352-15004/com.test E/TWC:         2139244912 |     19 | Websocket | reportConnectFail Could not resolve host tsock.us1.twilio.com: Host not found (authoritative), 12
2019-11-05 15:24:03.625 14352-15004/com.test D/TWC:         2139244912 |      4 | Twilsock.Client | onTransportDisconnected in state Transport connecting
2019-11-05 15:24:03.625 14352-15004/com.test D/TWC:         2139244912 |      4 | Twilsock.Client | onTransportDisconnectedImpl in state Transport connecting
2019-11-05 15:24:03.626 14352-15004/com.test D/TWC:         2139244912 |      5 | Twilsock.ClientImpl | stopTransportConnectingTimer
2019-11-05 15:24:03.626 14352-15004/com.test I/TWC:         2139244912 |      9 | State.TransportConnecting | Leaving state: Transport connecting
2019-11-05 15:24:03.626 14352-15004/com.test I/TWC:         2139244912 |     16 | State.Reconnecting | Entering state: Retry connect
2019-11-05 15:24:03.626 14352-15004/com.test D/TWC:         2139244912 |      5 | Twilsock.ClientImpl | setRetryTimeout: 64000
2019-11-05 15:24:03.626 14352-15004/com.test D/TWC:         2139244912 |      5 | Twilsock.ClientImpl | startRetryTimer 64000
2019-11-05 15:24:03.626 14352-15004/com.test D/TWC:         2139244912 |      5 | Twilsock.ClientImpl | setRetryTimeout: 128000
2019-11-05 15:25:07.645 14352-15004/com.test D/TWC:         2137172336 |      4 | Twilsock.Client | retryTimeoutImpl in state Retry connect
2019-11-05 15:25:07.645 14352-15004/com.test D/TWC:         2137172336 |      5 | Twilsock.ClientImpl | connect
2019-11-05 15:25:07.645 14352-15004/com.test D/TWC:         2137172336 |      5 | Twilsock.ClientImpl | stopRetryTimer
2019-11-05 15:25:07.645 14352-15004/com.test I/TWC:         2137172336 |     16 | State.Reconnecting | Leaving state: Retry connect
2019-11-05 15:25:07.649 14352-15004/com.test I/TWC:         2137172336 |      9 | State.TransportConnecting | Entering state: Transport connecting
2019-11-05 15:25:07.649 14352-15004/com.test D/TWC:         2137172336 |      5 | Twilsock.ClientImpl | startTransportConnectingTimer timeout: 60
2019-11-05 15:25:07.649 14352-15004/com.test D/TWC:        -2128152208 |     19 | Websocket | Connecting...
2019-11-05 15:25:08.353 14352-15004/com.test I/TWC:         2134063472 |     19 | Websocket | Connected
2019-11-05 15:25:08.354 14352-15004/com.test D/TWC:         2134063472 |      4 | Twilsock.Client | onTransportConnected in state Transport connecting
2019-11-05 15:25:08.354 14352-15004/com.test D/TWC:         2135099760 |      4 | Twilsock.Client | onTransportConnectedImpl in state Transport connecting
2019-11-05 15:25:08.354 14352-15004/com.test D/TWC:         2135099760 |      5 | Twilsock.ClientImpl | sendInit
2019-11-05 15:25:08.354 14352-15004/com.test E/TWC:         2135099760 |      5 | Twilsock.ClientImpl | Twilsock Tweaks: null

Versions

All relevant version information for issue, fill in below:

Chat Android SDK

4.2.5

Android API

API 26

Android Device

Moto g6

@berkus
Copy link
Contributor

berkus commented Jun 2, 2020

We will make it handle upload errors better, for the downloading we're going to release direct download URL for media in the next version.

@berkus berkus added disposition:filed-internally This issue has a Twilio-internal tracking ticket sdk-version:4.x labels Jun 2, 2020
@berkus
Copy link
Contributor

berkus commented Mar 31, 2021

All media improvements will be implemented in Twilio Conversations soon(ish) - we predict this year.

@berkus berkus closed this as completed Mar 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
disposition:filed-internally This issue has a Twilio-internal tracking ticket sdk-version:4.x
Projects
None yet
Development

No branches or pull requests

2 participants