Skip to content

chore: Align StreamTrimAsync signatures with StackExchange.Redis in 2.0 #486

Description

@currantw

Summary

Align StreamTrimAsync overload signatures exactly with StackExchange.Redis in the 2.0 release.

Description

Our current signatures differ from SER in two ways:

1. int overload has defaults (SER does not):

// Ours
Task<long> StreamTrimAsync(ValkeyKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None);

// SER
Task<long> StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength, CommandFlags flags);

2. long overload uses long? with default (SER uses non-nullable long):

// Ours (from pre-1.2)
Task<long> StreamTrimAsync(ValkeyKey key, long? maxLength = null, ...);

// SER
Task<long> StreamTrimAsync(RedisKey key, long maxLength, ...);

These are source-breaking changes for callers who rely on the defaults, so they should be deferred to a major version.

Proposed Solution

In 2.0:

  • Remove default values from the int overload parameters
  • Change long? maxLength = null to long maxLength in the long overload

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingIntroduces a breaking changecompatibilityStackExchange.Redis API compatibilitycoreCore library (`sources/Valkey.Glide/`)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions