Code review comment for lp:~facundo/ubuntuone-client/discriminate-auth-error

Facundo Batista (facundo) wrote :

Distinguish between Auth failure and other errors.

Now, we only go to AUTH_ERROR state if the Auth effectively failed; if something else happens, we go to unknown error, not provoking the applet to drop the token.

Here are snippets of the log for each situation, tested IRL with this changes (and lp:~facundo/ubuntuone-storage-protocol/discriminate_auth_error also applied):

Authentication OK:

  State - DEBUG - START_SET_CAPABILITIES --[SYS_SET_CAPABILITIES_OK]--> START_AUTHENTICATING
  EQ - DEBUG - push_event: SYS_STATE_CHANGED, args:(), kw:{'state': <NonActiveConnectedSDState START_AUTHENTICATING>}
  ActionQueue - INFO - Oauth OK
  EQ - DEBUG - push_event: SYS_OAUTH_OK, args:(), kw:{}

Authentication FAIL:

  State - DEBUG - START_SET_CAPABILITIES_WITH_METAQ --[SYS_SET_CAPABILITIES_OK]--> START_AUTHENTICATING_WITH_METAQ
  EQ - DEBUG - push_event: SYS_STATE_CHANGED, args:(), kw:{'state': <SyncDaemonState START_AUTHENTICATING_WITH_METAQ>}
  ActionQueue - ERROR - OAuth failed: AUTHENTICATION_FAILED
  EQ - DEBUG - push_event: SYS_OAUTH_ERROR, args:(), kw:{'error': 'AUTHENTICATION_FAILED'}
  State - DEBUG - Event arrived: cancelling timeout watchdog
  ActionQueue - DEBUG - disconnected
  State - DEBUG - START_AUTHENTICATING_WITH_METAQ --[SYS_OAUTH_ERROR]--> AUTH_FAILED
  EQ - DEBUG - push_event: SYS_STATE_CHANGED, args:(), kw:{'state': <AQErrorState AUTH_FAILED>}

Server answered INTERNAL_ERROR:

  State - DEBUG - START_SET_CAPABILITIES_WITH_METAQ --[SYS_SET_CAPABILITIES_OK]--> START_AUTHENTICATING_WITH_METAQ
  EQ - DEBUG - push_event: SYS_STATE_CHANGED, args:(), kw:{'state': <SyncDaemonState START_AUTHENTICATING_WITH_METAQ>}
  ActionQueue - ERROR - StorageRequestError during OAuth: INTERNAL_ERROR
  EQ - DEBUG - push_event: SYS_UNKNOWN_ERROR, args:(), kw:{}
  State - DEBUG - Event arrived: cancelling timeout watchdog
  EQ - DEBUG - push_event: SYS_DISCONNECT, args:(), kw:{}
  HQ - INFO - HashQueue: _hasher stopped
  DBus - INFO - Shuttingdown DBusInterface!
  ActionQueue - DEBUG - disconnected
  State - DEBUG - START_AUTHENTICATING_WITH_METAQ --[SYS_UNKNOWN_ERROR]--> UNKNOWN_ERROR
  EQ - DEBUG - push_event: SYS_STATE_CHANGED, args:(), kw:{'state': <AQErrorState UNKNOWN_ERROR>}

« Back to merge proposal