-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix crash during pickup if network is turned off #14
Conversation
Signed-off-by: Varun Chatterji <[email protected]>
Signed-off-by: Varun Chatterji <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I want to remove the comments I marked.
try { | ||
agent.messageSender.send(message) | ||
} catch (e: Exception) { | ||
// We catch the exception here because if there is a network failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems too verbose.
} else if (agent.agentConfig.mediatorPickupStrategy == MediatorPickupStrategy.Implicit) { | ||
// For implicit pickup, responseRequested must be set to false. | ||
// Since no response is requested, the mediator can respond with queued messages. | ||
// Otherwise, it would respond with a trust ping response. | ||
val message = OutboundMessage(TrustPingMessage("pickup", false), mediatorConnection) | ||
agent.messageSender.send(message, "ws") | ||
try { | ||
// We catch the exception here because if there is a network failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@conanoc I am ok with the changes but I cannot approve them in the review as I am the author. Would you like me to commit again with the comments removed? |
Signed-off-by: Varun Chatterji <[email protected]>
@conanoc removed the comments and committed again. |
Looks good to me. |
Merged. Thanks. |
In the current implementation, if the network is turned off, pickup of messages causes an application crash.
This PR fixes this by silently ignoring crashes during a pickup (as pickup will be retried at the polling frequency specified).
Also, there was no exception handling during the establishment of a connection (in the
WalletMainActivity
), this has been fixed too.@conanoc / @DrumRobot request you to review this and merge.