From fc9053e728aef741f52b9a947d524578871626bb Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Sat, 20 Jul 2024 20:38:27 -0700 Subject: [PATCH] Preparing v4.2 release. --- CHANGELOG.txt | 13 +++++++++++ channels/__init__.py | 2 +- docs/releases/4.2.0.rst | 48 +++++++++++++++++++++++++++++++++++++++++ docs/releases/index.rst | 1 + 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 docs/releases/4.2.0.rst diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 513abfd2..f9f868ab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,19 @@ Full release notes, with more details and upgrade information, are available at: https://channels.readthedocs.io/en/latest/releases +4.2.0 (expected by EOY 2024) +------------------ + +Channels 4.2 introduces a couple of major but backwards-compatible +changes, including most notably enhanced async suppport and fixing +a long-standing bug where tests would try and close db connections +and erroneously fail. + +There are a number of other small bugfixes. Please ensure to review the +`Version 4.2.0 release notes +`_ for full +details. + 4.1.0 (2024-04-03) ------------------ diff --git a/channels/__init__.py b/channels/__init__.py index ae5610fd..60912c2d 100644 --- a/channels/__init__.py +++ b/channels/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.1.0" +__version__ = "4.2.0" DEFAULT_CHANNEL_LAYER = "default" diff --git a/docs/releases/4.2.0.rst b/docs/releases/4.2.0.rst new file mode 100644 index 00000000..2ed15057 --- /dev/null +++ b/docs/releases/4.2.0.rst @@ -0,0 +1,48 @@ +4.2.0 Release Notes +=================== + +Channels 4.2 introduces a couple of major but backwards-compatible +changes, including most notably enhanced async suppport and fixing +a long-standing bug where tests would try and close db connections +and erroneously fail. + +Enhanced Async Support +---------------------- + +Support for asynchronous consumers has been greatly improved. +The documentation has been updated to reflect the async ORM +features added in Django 4.2. A new `channels.db.aclose_old_connections` +function has been added to easily close old database connections +in async consumers. + +Warning: Channels now automatically closes connections in async +consumers before a new connection, after recieving message (but +before dispatching to consumer code), and after disconnecting. + +This change has been made to more closely align with Django's +request/response cycle, and to help users avoid attempting +to use stale/broken connections. + +Notably, Channels does NOT close connections before or after +a consumer **sends** data. This is to avoid database churn and +more closely align with user expectations. Instead, users are +expected to call `aclose_old_connections` occasionally during +long-lived async connections. + + +Bugfixes & Small Changes +------------------------ + +* Database connections are no longer closed inside tests, which + prevents erroneous "Cannot operate on a closed database" errors + when running tets. + + Thanks to Jon Janzen. + +* An old import override and an unused deprecation message were removed + + Thanks to @sevdog (Devid) and Jon Janzen. + +* WebsocketCommunicator now has informative `assert` error messages + + Thanks to Karel Hovorka. \ No newline at end of file diff --git a/docs/releases/index.rst b/docs/releases/index.rst index 6c2ed298..f4954862 100644 --- a/docs/releases/index.rst +++ b/docs/releases/index.rst @@ -4,6 +4,7 @@ Release Notes .. toctree:: :maxdepth: 1 + 4.2.0 4.1.0 4.0.0 3.0.5