Skip to content

redis 6.x bump fails typecheck — RespVersions generic incompatibility #26

Description

@jazzsequence

Dependabot PR #23 (redis 5.11.0 → 6.2.1) fails npm run typecheck:

src/cache/redis.ts(21,5): error TS2322: Type 'RedisClientType<{}, {}, {}, 3, {}>' is not assignable to type 'RedisClientType<RedisModules, RedisFunctions, RedisScripts, RespVersions, TypeMapping> | null'.
  ...
    Type 'RespVersions' is not assignable to type '3'.
      Type '2' is not assignable to type '3'.

RedisClient in src/cache/redis.ts:3 is inferred as ReturnType<typeof createClient>, which now resolves to a concrete RESP-version-3-pinned type in redis 6.x, rather than the generic RespVersions union getRedisClient()'s return type expects.

Not investigated further — needs someone to look at whether createClient() should be called with explicit generic params (e.g. pinning RESP3), or whether RedisClient's type alias needs adjusting to match redis 6.x's new generic defaults. Left PR #23 unmerged; closing it once this is fixed and the bump is redone (or reopening/rebasing it, whichever's easier at the time).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions