Skip to content

Commit 910689d

Browse files
committed
Preparing v4.2 release.
1 parent e39fe13 commit 910689d

File tree

4 files changed

+77
-1
lines changed

4 files changed

+77
-1
lines changed

CHANGELOG.txt

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
Full release notes, with more details and upgrade information, are available at:
22
https://channels.readthedocs.io/en/latest/releases
33

4+
4.2.0 (expected by EOY 2024)
5+
------------------
6+
7+
Channels 4.2 introduces a couple of major but backwards-compatible
8+
changes, including most notably enhanced async suppport and fixing
9+
a long-standing bug where tests would try and close db connections
10+
and erroneously fail.
11+
12+
There are a number of other small bugfixes. Please ensure to review the
13+
`Version 4.2.0 release notes
14+
<https://channels.readthedocs.io/en/latest/releases/4.2.0.html>`_ for full
15+
details.
16+
417
4.1.0 (2024-04-03)
518
------------------
619

channels/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "4.1.0"
1+
__version__ = "4.2.0"
22

33

44
DEFAULT_CHANNEL_LAYER = "default"

docs/releases/4.2.0.rst

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
4.2.0 Release Notes
2+
===================
3+
4+
Channels 4.2 introduces a couple of major but backwards-compatible
5+
changes, including most notably enhanced async suppport and fixing
6+
a long-standing bug where tests would try and close db connections
7+
and erroneously fail.
8+
9+
Additionally, support has been added for Django 5.1.
10+
11+
Enhanced Async Support
12+
----------------------
13+
14+
Support for asynchronous consumers has been greatly improved.
15+
The documentation has been updated to reflect the async ORM
16+
features added in Django 4.2. A new `channels.db.aclose_old_connections`
17+
function has been added to easily close old database connections
18+
in async consumers.
19+
20+
Warning: Channels now automatically closes connections in async
21+
consumers before a new connection, after recieving message (but
22+
before dispatching to consumer code), and after disconnecting.
23+
24+
This change has been made to more closely align with Django's
25+
request/response cycle, and to help users avoid attempting
26+
to use stale/broken connections.
27+
28+
Notably, Channels does NOT close connections before or after
29+
a consumer **sends** data. This is to avoid database churn and
30+
more closely align with user expectations. Instead, users are
31+
expected to call `aclose_old_connections` occasionally during
32+
long-lived async connections.
33+
34+
Additionally, channels will automatically use the new async
35+
interface for sessions if Django 5.1 or greater is installed.
36+
This new interface can be slightly faster in certain cases
37+
as it does not always need to context-switch into synchronous
38+
execution. This does require a backwards-incompatible change to
39+
`channels.sessions.InstanceSessionWrapper`: the `save_session`
40+
function is now `async`. If `InstanceSessionWrapper` was being
41+
subclassed in some way (note that this class is an implementation
42+
detail and not documented) and `save_session` was being called
43+
or overridden, it will need to be updated to be called with `await`
44+
or defined as `async`, respectively.
45+
46+
47+
Bugfixes & Small Changes
48+
------------------------
49+
50+
* Database connections are no longer closed inside tests, which
51+
prevents erroneous "Cannot operate on a closed database" errors
52+
when running tets.
53+
54+
Thanks to Jon Janzen.
55+
56+
* An old import override and an unused deprecation message were removed
57+
58+
Thanks to @sevdog (Devid) and Jon Janzen.
59+
60+
* WebsocketCommunicator now has informative `assert` error messages
61+
62+
Thanks to Karel Hovorka.

docs/releases/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Release Notes
44
.. toctree::
55
:maxdepth: 1
66

7+
4.2.0
78
4.1.0
89
4.0.0
910
3.0.5

0 commit comments

Comments
 (0)