Skip to content

Improvement: Distinguish Between "API Error" and "User Not Found" #353

Description

@Yashaswini-K-P

Description

Currently, analyze-inactivity.js treats all fetchData failures as "unreachable." This is problematic because it fails to distinguish between a temporary network/server issue (500 Error) and a permanent issue where the user account no longer exists (404 Error).

Proposed Solution

Modify fetchData to return the HTTP status code. The inactivity analysis should categorize these failures:

  1. 500/503/429 (Temporary): Keep the user in the list to be checked again.
  2. 404 (Permanent): Flag the user as "invalid" and add them to a separate report for cleanup or manual verification.

Implementation Details

  • Update fetchData to return an object containing { data, status } rather than just null.
  • Update the logic in the main loop to handle status === 404 separately.
  • Create an invalid-users.json or update the final output object to include an invalidUsers array.

Benefits

  • System Maintenance: Automatically identifies broken accounts that need to be removed or updated.
  • Resource Efficiency: Avoids repeatedly polling for usernames that will never return a successful response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions