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:
- 500/503/429 (Temporary): Keep the user in the list to be checked again.
- 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.
Description
Currently,
analyze-inactivity.jstreats allfetchDatafailures 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
fetchDatato return the HTTP status code. The inactivity analysis should categorize these failures:Implementation Details
fetchDatato return an object containing{ data, status }rather than justnull.status === 404separately.invalid-users.jsonor update the final output object to include aninvalidUsersarray.Benefits