Skip to content

parity(auth): include Cloudflare error codes in network error handling [from supabase-js] #248

Closed

Description

@grdsdev

SDK Parity: C# implementation needed

A bug fix was made in supabase-js that needs to be applied in supabase-community/gotrue-csharp for SDK parity.

Reference Implementation (supabase-js)

What Changed

Expanded NETWORK_ERROR_CODES to include Cloudflare-specific codes (520-524, 530). These infrastructure errors should not cause session invalidation.

Current State in supabase-csharp

FailureReason.cs handles specific HTTP codes (400, 401, 403, 404, 422, 429) but has no entries for Cloudflare codes. They fall through to Unknown rather than being classified as network/transient errors. NetworkStatus.cs only uses OS-level network availability checks.

Implementation Guidance

Add Cloudflare error codes to the failure detection logic so they are treated as transient network errors rather than auth failures. These should trigger retry behavior, not session invalidation.

Key Behaviors to Match

  • Error codes 520-524, 530 treated as transient/retryable
  • These codes do NOT trigger session removal
  • Consistent with standard gateway errors (502, 503, 504)

Acceptance Criteria

  • Cloudflare codes handled as network/transient errors
  • Session not invalidated on Cloudflare errors
  • Unit tests
  • No breaking changes

Context

  • supabase-js version: v2.103.1+
  • Parity tracking: This issue was auto-generated by SDK parity analysis

Generated with Claude Code /sync-sdk-parity

Activity

  1. self-assigned this
    on Jul 1, 2026
  2. Tr00d commented on Sep 10, 2026

    @Tr00d
    Contributor

    Fixed with #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions