Skip to content

parity(postgrest): add URL length validation and timeout protection [from supabase-js] #235

@grdsdev

Description

@grdsdev

SDK Parity: C# implementation needed

A change was made in supabase-js that needs to be implemented in this repository for SDK parity.

Reference Implementation (supabase-js)

  • Commit: 7ec2df9
  • PR: #2078
  • Module: postgrest
  • Type: new-feature

What Changed

Two new configuration options were added to PostgrestClient:

  1. timeout (optional): Timeout in milliseconds. Requests auto-abort after this duration.
  2. urlLengthLimit (default: 8000): Maximum URL length before warning/error.

Code Reference

export default class PostgrestClient {
  urlLengthLimit: number

  constructor(url: string, {
    timeout,
    urlLengthLimit = 8000,
  })
}

Implementation Guidance

Expected API Surface (C#)

public class ClientOptions
{
    public TimeSpan? Timeout { get; set; }        // NEW
    public int UrlLengthLimit { get; set; } = 8000; // NEW
}

Key Behaviors to Match

  • Timeout: Use CancellationTokenSource with timeout for auto-cancellation
  • UrlLengthLimit: Defaults to 8000. Validates URL before request
  • Both propagated from SupabaseClient to Postgrest client
  • PascalCase per C# conventions

Acceptance Criteria

  • Timeout option added to ClientOptions
  • UrlLengthLimit option added with default of 8000
  • URL length validation before request execution
  • Timeout cancels requests via CancellationToken
  • Unit tests cover both features
  • Documentation updated

Context

  • supabase-js version: v2.95.3
  • Parity tracking: This issue was auto-generated by SDK parity analysis
  • Related parity issues: SDK-698 (dart), SDK-699 (py), SDK-700 (swift)

Generated with Claude Code /sync-sdk-parity

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