Skip to content

Bug: Incorrect retriability classification in CelestraError #175

@leogdion

Description

@leogdion

Problem

CelestraError.swift has incorrect retriability classifications:

  • invalidResponse and underlyingError may be incorrectly classified as retriable or non-retriable
  • May cause unnecessary retries or miss retriable errors

Proposed Solution

Review and correct retriability logic for each error case:

var isRetriable: Bool {
    switch self {
    case .networkError, .timeout:
        return true  // Network issues are retriable
    case .invalidResponse:
        return false  // Malformed responses won't fix on retry
    case .underlyingError(let error):
        // Check underlying error type
        if let urlError = error as? URLError {
            return urlError.code == .timedOut || 
                   urlError.code == .networkConnectionLost
        }
        return false
    case .rateLimited:
        return true  // Can retry after backoff
    }
}

Impact

  • Reliability: Correct retry behavior
  • Performance: Avoid wasteful retries
  • User Experience: Faster failure for non-retriable errors

Files Affected

  • Examples/Celestra/Sources/Celestra/Services/CelestraError.swift

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions