You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,53 @@
1
1
# CHANGELOG
2
+
## Version 0.61.3 (March 2026)
3
+
4
+
**Released**: March 18, 2026
5
+
6
+
This release hardens the WebSocket client with improved thread-safety, bounded message queues, and better error handling.
7
+
8
+
---
9
+
10
+
### 1. NEW FEATURES
11
+
12
+
#### **Bounded Message Queue (`queue_maxsize`)**
13
+
The `_MistWebsocket` client now supports a `queue_maxsize` parameter to limit the internal message buffer size. When set, incoming messages are dropped with a warning when the queue is full, preventing unbounded memory growth on high-frequency streams.
14
+
15
+
```python
16
+
ws = mistapi.websockets.sites.DeviceStatsEvents(
17
+
apisession,
18
+
site_ids=["<site_id>"],
19
+
queue_maxsize=1000# Limit buffer to 1000 messages
20
+
)
21
+
```
22
+
23
+
---
24
+
25
+
### 2. IMPROVEMENTS
26
+
27
+
#### **Thread-Safety Enhancements**
28
+
- Added `threading.Lock()` to protect shared state during concurrent access
29
+
- Added `_finished` event for cleaner lifecycle management and proper shutdown signaling
30
+
31
+
#### **Error Handling Hardening**
32
+
- User-provided callbacks (`on_open`, `on_message`, `on_error`, `on_close`) are now wrapped in try/except blocks to prevent exceptions from crashing the WebSocket thread
33
+
- Added warning when `cloud_uri` does not start with `"api."` (WebSocket URL may be incorrect)
34
+
35
+
#### **Security: Header Redaction**
36
+
- Added `_HeaderRedactFilter` to automatically redact `Authorization` and `Cookie` headers from `websocket-client` debug logs
37
+
38
+
---
39
+
40
+
### 3. API CHANGES
41
+
42
+
#### **Insights API**
43
+
Added optional `port_id` query parameter to the following functions for port-level filtering:
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ A comprehensive Python package to interact with the Mist Cloud APIs, built from
32
32
-[Examples](#examples)
33
33
-[WebSocket Streaming](#websocket-streaming)
34
34
-[Connection Parameters](#connection-parameters)
35
-
-[Callbacks](#callbacks)
35
+
-[Methods](#methods)
36
36
-[Available Channels](#available-channels)
37
37
-[Usage Patterns](#usage-patterns)
38
38
-[Async Usage](#async-usage)
@@ -588,6 +588,7 @@ All channel classes accept the following optional keyword arguments:
588
588
|`auto_reconnect`|`bool`|`False`| Automatically reconnect on transient failures using exponential backoff. |
589
589
|`max_reconnect_attempts`|`int`|`5`| Maximum number of reconnect attempts before giving up. |
590
590
|`reconnect_backoff`|`float`|`2.0`| Base backoff delay in seconds. Doubles after each failed attempt (2s, 4s, 8s, ...). Resets on successful reconnection. |
591
+
|`queue_maxsize`|`int`|`0`| Maximum messages buffered in the internal queue for `receive()`. `0` means unbounded. When set, incoming messages are dropped with a warning when the queue is full, preventing memory growth on high-frequency streams. |
0 commit comments