Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redis/ioredis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.28.0
Choose a base ref
...
head repository: redis/ioredis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.28.1
Choose a head ref
  • 4 commits
  • 7 files changed
  • 5 contributors

Commits on Oct 21, 2021

  1. docs(README): add Upstash

    luin committed Oct 21, 2021
    Copy the full SHA
    cfb470d View commit details

Commits on Oct 22, 2021

  1. docs: Document enableTLSForSentinelMode Option (#1448)

    Add to the sentinel section of the readme.  Without this option, encrypted versions of redis sentinel fail with obscure errors
    
    Co-authored-by: peter <peter@xwin32.com>
    cintolas and peter authored Oct 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    77ad094 View commit details

Commits on Nov 23, 2021

  1. fix: handle possible unhandled promise rejection with autopipelining+…

    …cluster (#1467)
    
    Deliberately add `asCallback` on the **same** Promise instance being returned,
    not on a different Promise instance that resolves to the same thing.
    
    Avoid this error:
    
    ```javascript
    process.on('unhandledRejection', (reason) => console.log('unhandledRejection', reason));
    const x = Promise.reject(new Error());
    x.catch((e) => console.log('caught x', e));
    
    const causesUnhandledRejection = Promise.resolve().then(() => x);
    ```
    
    Related to #1466
    TysonAndre authored Nov 23, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6ad285a View commit details
  2. chore(release): 4.28.1 [skip ci]

    ## [4.28.1](v4.28.0...v4.28.1) (2021-11-23)
    
    ### Bug Fixes
    
    * handle possible unhandled promise rejection with autopipelining+cluster ([#1467](#1467)) ([6ad285a](6ad285a)), closes [#1466](#1466)
    semantic-release-bot committed Nov 23, 2021
    Copy the full SHA
    2ee877e View commit details
Showing with 49 additions and 24 deletions.
  1. +7 −0 Changelog.md
  2. +21 −6 README.md
  3. +19 −16 lib/autoPipelining.ts
  4. +1 −1 package-lock.json
  5. +1 −1 package.json
  6. BIN resources/medis.png
  7. BIN resources/upstash.png
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [4.28.1](https://github.com/luin/ioredis/compare/v4.28.0...v4.28.1) (2021-11-23)


### Bug Fixes

* handle possible unhandled promise rejection with autopipelining+cluster ([#1467](https://github.com/luin/ioredis/issues/1467)) ([6ad285a](https://github.com/luin/ioredis/commit/6ad285a59f4a46d5452a799371dfbd69a07ac9f9)), closes [#1466](https://github.com/luin/ioredis/issues/1466)

# [4.28.0](https://github.com/luin/ioredis/compare/v4.27.11...v4.28.0) (2021-10-13)


27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -42,11 +42,26 @@ used in the world's biggest online commerce company [Alibaba](http://www.alibaba
- [Error Handling](#error-handling)

<hr>
<a href="http://bit.ly/medis-macos"><img align="right" src="resources/medis.png" alt="Download on the App Store"></a>

### [AD] Medis: Redis GUI for OS X
# Sponsors

Looking for a Redis GUI manager for OS X, Windows and Linux? Here's [Medis](http://bit.ly/medis-macos)!
<a href="https://github.com/sponsors/luin">Become a sponsor!</a>

### Upstash: Serverless Database for Redis

<a href="https://upstash.com/?utm_source=ioredis"><img align="right" width="320" src="resources/upstash.png" alt="Upstash"></a>

Upstash is a Serverless Database with Redis/REST API and durable storage. It is the perfect database for your applications thanks to its per request pricing and low latency data.

[Start for free in 30 seconds! ](https://upstash.com/?utm_source=ioredis)

<br clear="both"/>

### Medis: Redis GUI for macOS

<a href="https://getmedis.com/"><img align="right" width="404" src="resources/medis.png" alt="Download on the App Store"></a>

Looking for a Redis GUI for macOS, Windows and Linux? Here's [Medis](https://getmedis.com/)!

Medis is an open-sourced, beautiful, easy-to-use Redis GUI management application.

@@ -55,12 +70,11 @@ Medis starts with all the basic features you need:
- Keys viewing/editing
- SSH Tunnel for connecting with remote servers
- Terminal for executing custom commands
- JSON/MessagePack format viewing/editing and built-in highlighting/validator
- And other awesome features...

[Medis is open sourced on GitHub](https://github.com/luin/medis)
[Medis 1 is open sourced on GitHub](https://github.com/luin/medis)

### [AD] Kuber: Kubernetes Dashboard for iOS
### Kuber: Kubernetes Dashboard for iOS

<a href="http://bit.ly/kuber-ios"><img src="resources/kuber.png" alt="Download on the App Store"></a>

@@ -863,6 +877,7 @@ The arguments passed to the constructor are different from the ones you use to c
- `sentinels` are a list of sentinels to connect to. The list does not need to enumerate all your sentinel instances, but a few so that if one is down the client will try the next one.
- `role` (optional) with a value of `slave` will return a random slave from the Sentinel group.
- `preferredSlaves` (optional) can be used to prefer a particular slave or set of slaves based on priority. It accepts a function or array.
- `enableTLSForSentinelMode` (optional) set to true if connecting to sentinel instances that are encrypted

ioredis **guarantees** that the node you connected to is always a master even after a failover. When a failover happens, instead of trying to reconnect to the failed node (which will be demoted to slave when it's available again), ioredis will ask sentinels for the new master node and connect to it. All commands sent during the failover are queued and will be executed when the new connection is established so that none of the commands will be lost.

35 changes: 19 additions & 16 deletions lib/autoPipelining.ts
Original file line number Diff line number Diff line change
@@ -121,22 +121,25 @@ export function executeWithAutoPipelining(
// On cluster mode let's wait for slots to be available
if (client.isCluster && !client.slots.length) {
if (client.status === "wait") client.connect().catch(noop);
return new CustomPromise(function (resolve, reject) {
client.delayUntilReady((err) => {
if (err) {
reject(err);
return;
}

executeWithAutoPipelining(
client,
functionName,
commandName,
args,
callback
).then(resolve, reject);
});
});
return asCallback(
new CustomPromise(function (resolve, reject) {
client.delayUntilReady((err) => {
if (err) {
reject(err);
return;
}

executeWithAutoPipelining(
client,
functionName,
commandName,
args,
null
).then(resolve, reject);
});
}),
callback
);
}

// If we have slot information, we can improve routing by grouping slots served by the same subset of nodes
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ioredis",
"version": "4.28.0",
"version": "4.28.1",
"description": "A robust, performance-focused and full-featured Redis client for Node.js.",
"main": "built/index.js",
"files": [
Binary file modified resources/medis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/upstash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.