# What changed in fakeredis

> 66 changes in fakeredis 2 from its official release notes, upgrade guides and advisories: 5 breaking, 23 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/pypi/fakeredis/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## fakeredis 2

### Breaking changes

- Instances with version 10 no longer share a server with instances with version 1. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Unsorted SORT results are now sorted in scripts and with STORE. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Returns unsorted results in geohash order rather than insertion order. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Does not raise WRONGTYPE for a wrongly typed destination when the source key is missing. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Moves an entry's pending count to the claiming consumer instead of leaving it on the previous owner. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)

### New APIs and options

- Implements the Redis 8.4 DELEX command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the Redis 8.4 DIGEST command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- DIGEST requires the new digest extra, installable with pip install "fakeredis[digest]". (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the Redis 8.10 HIMPORT DISCARD command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the Redis 8.10 HIMPORT DISCARDALL command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the Redis 8.10 HIMPORT PREPARE command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the Redis 8.10 HIMPORT SET command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Implements the JSON.NUMPOWBY command. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Async connections report addr, laddr, and fd. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 BLMOVEM command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds the kividb server type, matching KiviDB 1.0.4's command surface. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 LMOVEM command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 SDIFFCARD command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for SORT_RO. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 SUNIONCARD command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 TS.NRANGE command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 TS.NREVRANGE command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 TS.QUERYLABELS command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Adds support for the Redis 8.10 TS.READ command. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Accepts the KEEPREF, DELREF, and ACKED reference policies. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Accepts the KEEPREF, DELREF, and ACKED reference policies. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Implements Dragonfly's rate-limiting command, including its time-field rounding, remaining-count truncation, and oversized-request behavior. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Supports redis.setresp(2) and redis.setresp(3); the setting resets to RESP2 for each run and is not exposed when emulating Dragonfly. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)

### Performance

- Expires keys and hash fields through a heap instead of scanning. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves performance for large replies. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves Lua table conversion performance. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Lowers per-command and client-construction overhead. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves iteration performance for the SCAN family. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves SPOP performance. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves SRANDMEMBER performance. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)
- Improves performance of stream range reads with COUNT. (2.40.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.40.0)

### Behavior and default changes

- Each connection gets one client ID and a new one on reconnect. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Matches Dragonfly's command errors, validation, limits, and selected command behavior, including expiry handling, string limits, sorting, copying, geospatial ordering, watched-key dirtiness, scripting, and JSON quirks. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Matches Dragonfly's command replies for numeric results, blocking reads, sorted-set replies, empty streams, unknown lag, pending lookups, and pub/sub namespaces. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)

### Fixes and other changes

- Pads shorter operands and treats missing keys as empty. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Searches on a missing member return Redis'/Valkey 9's error instead of crashing. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Commands on a missing key return Redis' errors. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Keeps the member when clearing its TTL. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Raises valkey exceptions. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Works for FakeValkey, FakeStrictValkey, and FakeAsyncValkey. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Searches on a missing member return Redis'/Valkey 9's error instead of crashing. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Stops polling when called with timeout=.... (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Invalidates WATCH like Redis. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Invalidates WATCH like Redis. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Answers RESP2 clients in RESP2. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- A single observation now follows Redis 8.10 behavior. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Never reuses deleted IDs and rejects invalid IDs like Redis. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- SETID and CREATE, entries-read, and lag follow Redis' rules. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- An end ID without a sequence is treated as the whole millisecond. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- An end ID without a sequence is treated as the whole millisecond. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- An end ID without a sequence is treated as the whole millisecond. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Approximate trimming drops whole nodes. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- Fixes ZSCAN while deleting. (2.39.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.39.0)
- On pre-7.0 servers, reports a syntax error before decoding range arguments. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Cancelling a blocking async command no longer returns a connection to the pool with its socket paused, which previously caused later commands to hang. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Lua scripts now receive RESP2-shaped replies from redis.call regardless of the negotiated client protocol, matching Redis. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- No longer raises a raw Python KeyError when a pending entry has no live consumer. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Returns the cursor for the next pending-entry scan, and returns 0-0 when the pending list is exhausted. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Honours JUSTID when updating an entry's delivery counter; RETRYCOUNT takes precedence when both are supplied. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Honours RETRYCOUNT when updating an entry's delivery counter; a negative value means it was not given. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
- Removes entries owned by the deleted consumer and returns how many entries it dropped. (2.38.0) — [release notes](https://github.com/cunla/fakeredis-py/releases/tag/v2.38.0)
