Skip to content

Enhancement: Add built-in retry logic for transient failures #4

@akberc

Description

@akberc

Summary

Add configurable retry logic for handling transient network failures and server busy responses.

Motivation

Network connections can experience temporary failures. Currently, applications must implement their own retry logic. Built-in retry support would improve reliability.

Proposed Configuration

\\ ypescript
const client = await ImapClient.connect({
imap: {
host: 'imap.gmail.com',
// ... other options
},
retry: {
maxAttempts: 3,
initialDelay: 1000,
maxDelay: 30000,
backoffMultiplier: 2,
retryableErrors: ['ETIMEDOUT', 'ECONNRESET', 'SERVER_BUSY']
}
});
\\

Scenarios to Handle

  • Network timeouts (ETIMEDOUT)
  • Connection resets (ECONNRESET)
  • Server busy responses
  • Temporary authentication failures

Benefits

  • Improved reliability without custom code
  • Configurable retry behavior
  • Exponential backoff to avoid overwhelming servers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions