Skip to content

Bug: token validation deletes cached config on transient server or network failures #232

@codxbrexx

Description

@codxbrexx

Summary

validateToken() removes the local config file for any exception thrown by api.validate().
That includes temporary outages, DNS failures, or non-auth server errors, so a valid cached token can be erased even when the credentials are fine.

Steps To Reproduce

  1. Log in successfully so config.ini contains a valid token.
  2. Run the CLI while the remote API is temporarily unreachable or returns a non-auth error.
  3. api.validate() throws.
  4. The CLI deletes the cached config and asks the user to log in again.

Expected Behavior

Only authentication-specific failures should invalidate the cached token.
Transient connectivity or server problems should preserve local config and surface a precise error.

Actual Behavior

The config cache is deleted for any validation failure, even when the token itself is valid.

Proposed Fix

  • Distinguish auth failures from transport/server failures before deleting config.
  • Preserve the cached config for transient errors.
  • Return a more accurate error message when validation fails for non-auth reasons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions