Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove extraneous TCP/IPC properties from RedisOptions TS type #1707

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

schmod
Copy link
Contributor

@schmod schmod commented Jan 24, 2023

Node 18 introduced a new keepAlive option in the TCP socket constructor.

This causes ioredis's TypeScript typings to clash with @types/node, because we define keepAlive as number | undefined, whereas Node defines it as a boolean.

Luckily, this isn't a runtime regression. We don't pass keepAlive into createConnection, and in fact only pass in three properties total. But we pretend that any property of TcpNetConnectOptions can be included in RedisOptions.

This PR reduces the surface-area of RedisOptions to only include the TCP and IPC connection parameters that we actually use, which results in keepAlive once again having the correct TS type.

It should also be less confusing for users, as we've removed several unused properties off of that interface...

Fixes #1680
Fixes #1684

@luin luin merged commit 9af7b1c into redis:main Jan 25, 2023
@luin
Copy link
Collaborator

luin commented Jan 25, 2023

Thanks for the contribution!

github-actions bot pushed a commit that referenced this pull request Jan 25, 2023
## [5.2.6](v5.2.5...v5.2.6) (2023-01-25)

### Bug Fixes

* remove extraneous TCP/IPC properties from RedisOptions TS type ([#1707](#1707)) ([9af7b1c](9af7b1c))
@github-actions
Copy link

🎉 This PR is included in version 5.2.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

luin pushed a commit that referenced this pull request Apr 15, 2023
## [5.2.6](v5.2.5...v5.2.6) (2023-01-25)

### Bug Fixes

* remove extraneous TCP/IPC properties from RedisOptions TS type ([#1707](#1707)) ([9af7b1c](9af7b1c))
janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this pull request Mar 1, 2024
## [5.2.6](redis/ioredis@v5.2.5...v5.2.6) (2023-01-25)

### Bug Fixes

* remove extraneous TCP/IPC properties from RedisOptions TS type ([#1707](redis/ioredis#1707)) ([9af7b1c](redis/ioredis@9af7b1c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants