Skip to content

Conversation

@konard
Copy link
Owner

@konard konard commented Oct 17, 2025

Summary

Fixed the AbortError that occurred when retrieving friends to delete deactivated ones by increasing the VK API timeout configuration.

Root Cause

The vk.api.friends.get() API call was timing out with the default 10-second timeout when attempting to retrieve large friend lists. This caused the following error:

AbortError: The operation was aborted.
    at abort (file:///root/bots/vk-bot/node_modules/node-fetch/src/index.js:70:18)
    at AbortSignal.abortAndFinalize (file:///root/bots/vk-bot/node_modules/node-fetch/src/index.js:89:4)
    at Timeout.<anonymous> (/root/bots/vk-bot/node_modules/vk-io/lib/index.js:1769:53)

Solution

Increased the apiTimeout configuration from the default 10,000ms (10 seconds) to 30,000ms (30 seconds) when initializing the VK instance in index.js. This allows sufficient time for the VK API to respond when retrieving large friend lists.

Changes

  • Modified index.js to configure VK instance with apiTimeout: 30000

Testing

The fix addresses the timeout issue by providing adequate time for the API request to complete. The 30-second timeout is a reasonable balance between allowing slow requests to complete and preventing indefinite hangs.

Fixes #31


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: undefined
@konard konard self-assigned this Oct 17, 2025
The friends.get API call was timing out with the default 10s timeout
when retrieving friend lists. This caused AbortError: The operation
was aborted during the deleteDeactivatedFriendsTrigger execution.

Solution: Increase apiTimeout from default 10000ms to 30000ms (30s)
to allow enough time for the VK API to respond with large friend lists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] index.js: Could not retrieve friends to delete deactivated ones: AbortError: The operation was aborted. Fix AbortError in friends.get by increasing apiTimeout Oct 17, 2025
@konard konard marked this pull request as ready for review October 17, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index.js: Could not retrieve friends to delete deactivated ones: AbortError: The operation was aborted.

1 participant