|
| 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 | +Enhanced Async Support |
| 10 | +---------------------- |
| 11 | + |
| 12 | +Support for asynchronous consumers has been greatly improved. |
| 13 | +The documentation has been updated to reflect the async ORM |
| 14 | +features added in Django 4.2. A new `channels.db.aclose_old_connections` |
| 15 | +function has been added to easily close old database connections |
| 16 | +in async consumers. |
| 17 | + |
| 18 | +Warning: Channels now automatically closes connections in async |
| 19 | +consumers before a new connection, after recieving message (but |
| 20 | +before dispatching to consumer code), and after disconnecting. |
| 21 | + |
| 22 | +This change has been made to more closely align with Django's |
| 23 | +request/response cycle, and to help users avoid attempting |
| 24 | +to use stale/broken connections. |
| 25 | + |
| 26 | +Notably, Channels does NOT close connections before or after |
| 27 | +a consumer **sends** data. This is to avoid database churn and |
| 28 | +more closely align with user expectations. Instead, users are |
| 29 | +expected to call `aclose_old_connections` occasionally during |
| 30 | +long-lived async connections. |
| 31 | + |
| 32 | + |
| 33 | +Bugfixes & Small Changes |
| 34 | +------------------------ |
| 35 | + |
| 36 | +* Database connections are no longer closed inside tests, which |
| 37 | + prevents erroneous "Cannot operate on a closed database" errors |
| 38 | + when running tets. |
| 39 | + |
| 40 | + Thanks to Jon Janzen. |
| 41 | + |
| 42 | +* An old import override and an unused deprecation message were removed |
| 43 | + |
| 44 | + Thanks to @sevdog (Devid) and Jon Janzen. |
| 45 | + |
| 46 | +* WebsocketCommunicator now has informative `assert` error messages |
| 47 | + |
| 48 | + Thanks to Karel Hovorka. |
0 commit comments