Skip to content

fix(ocpp-wamp): OkHttp client reports a connection failure as a connection lost #148

Open

Description

@juherr

OkHttpOcppWampClient.onFailure (OkHttpOcppWampClient.kt:180-182) sets
connectionState = DISCONNECTED before testing connectionState == CONNECTING. The test is
therefore always false: a failure during connection is reported as onConnectionLost instead of
onConnectionFailure, and logged as "failure with connection".

tryToConnect still completes, because its onConnectionLost counts down the latch "just in
case", but the listener contract (ConnectionListener.onConnectionFailure) is never honoured on
that path.

Found while working on #108 (PR #147).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions