Skip to content

A modern and elegant dashboard for network traffic visualization and analysis.

release: v1.3.9 — data-loss & stability fixes, contributor PRs

luolei1d53f0f0234d
diff --git a/CHANGELOG.en.md b/CHANGELOG.en.md
index 41b67d6..aee11a4 100644
--- a/CHANGELOG.en.md
+++ b/CHANGELOG.en.md
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.3.9] - 2026-06-23
+
+### Fixed
+
+- **Silent persistence data loss when ClickHouse degrades** 🐛
+ - When ClickHouse was considered healthy the SQLite stats write was skipped, but the in-memory batch was cleared before the async ClickHouse write was confirmed. If that write failed (queue full / partial table failure / timeout) the data only lived briefly in the realtime memory store and was never persisted. The collector now writes the batch snapshot to SQLite as a durable fallback whenever the ClickHouse write fails and SQLite was skipped
+ - A full write queue now counts toward the unhealthy threshold so callers resume durable SQLite writes
+ - Health is reset only after a *complete* (detail + agg) traffic batch succeeds, so a table that fails persistently while another succeeds can no longer keep resetting the failure counter and mask the outage
+- **Agent mode under-counted traffic on counter resets** 🐛
+ - The Go agent dropped traffic to zero when a flow's counter went backwards (gateway restart / connection id reuse), diverging from the already-fixed direct collector. It now counts the current value as new traffic and re-counts the connection
+- **Deleting a backend left orphaned data** 🐛
+ - `PRAGMA foreign_keys` defaults OFF so the declared `ON DELETE CASCADE` never fired; deleting a backend removed only the config row and left all of its stats behind. `deleteBackend` now explicitly removes all associated data (including health logs, policy cache, agent heartbeats and snapshots)
+- **Collector did not recover after a backend password change** ([#65]) 🐛
+ - When a credential change restarted the collector, `disconnect` deferred the real teardown until after an async flush, so the old WebSocket kept reconnecting with the stale token and detached from management. The socket is now torn down synchronously first (set `isClosing`, clear the reconnect timer, close the socket) and flushed afterward
+- **WebSocket port env vars had no effect** ([#61]) 🐛
+ - `runtime-config.js` (written with the real external ports at container start) suffered a script-load race and caching, so the browser fell back to the build-time default port and `WS_EXTERNAL_PORT` appeared ineffective. The script is now loaded `beforeInteractive`, served `no-store`, and excluded from the PWA precache
+- **Mihomo proxy groups parsed as rules** ([#67], PR [#68] by @cesaryuan) 🐛
+ - Rule names no longer mis-use the last chain hop (the proxy group); they use the real matched rule, centralized into a shared `buildRuleName` helper that also removes drift between the multiple write paths
+- **Collector silently hangs, stops syncing** ([#74], PR [#76] by @zj1123581321) 🐛
+ - Adds a WebSocket heartbeat watchdog: it pings periodically and tracks last activity, force-terminating a silent link past the timeout to trigger the existing reconnect logic — fixing silently dropped TCP connections (gateway restart / NAT timeout) that left the socket "connected" while data stopped
+
+### Improved
+
+- **WebSocket reconnect now uses exponential backoff with jitter**: prevents a reconnect storm when several collectors hammer a down/flapping backend every 5s in lockstep; backoff resets after a successful connect. The Surge collector's backoff retries also gain jitter (`WS_MAX_RECONNECT_INTERVAL_MS`, default 60s)
+
+[#61]: https://github.com/foru17/neko-master/issues/61
+[#65]: https://github.com/foru17/neko-master/issues/65
+[#67]: https://github.com/foru17/neko-master/issues/67
+[#68]: https://github.com/foru17/neko-master/pull/68
+[#74]: https://github.com/foru17/neko-master/issues/74
+[#76]: https://github.com/foru17/neko-master/pull/76
+
## [1.3.8] - 2026-06-10
### Fixed
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 67db222..8c3c28e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,38 @@
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/spec/v2.0.0.html)。
+## [1.3.9] - 2026-06-23
+
+### 修复
+
+- **ClickHouse 降级时静默丢失持久化数据** 🐛
+ - 当 ClickHouse 被判定为健康时会跳过 SQLite 写入,但内存批次在 ClickHouse 异步写入确认前就被清空;一旦写入失败(队列满 / 部分表失败 / 超时),数据只短暂留在实时内存里,从未落盘。现在 ClickHouse 写入失败且 SQLite 被跳过时,会把本批快照回灌写入 SQLite 作为持久化兜底
+ - 写入队列已满现在计入「不健康」阈值,使采集器恢复 SQLite 写入
+ - 健康状态只在「detail+agg 整批」成功后才重置,避免某个表持续失败、另一个表成功时反复重置计数从而长期掩盖故障
+- **Agent 模式计数器重置漏记流量** 🐛
+ - Go Agent 在计数器回退(网关重启 / 连接 ID 复用)时把增量置 0 丢弃流量,与已修复的直采采集器不一致。现在同样将当前值计为新流量并重新计入连接数
+- **删除后端遗留孤儿数据** 🐛
+ - `PRAGMA foreign_keys` 默认关闭使 `ON DELETE CASCADE` 从未生效,删除后端只删除配置行、残留所有统计数据。`deleteBackend` 现显式删除全部关联数据(含健康日志、策略缓存、Agent 心跳与快照)
+- **更新后端密码后采集不恢复**([#65])🐛
+ - 凭据变更触发采集器重启时,`disconnect` 把真正的断开延迟到异步 flush 之后,旧 WebSocket 仍带旧 token 重连并脱离管理。现在先同步断开(置 `isClosing`、清重连定时器、关闭 socket)再 flush
+- **WebSocket 端口环境变量不生效**([#61])🐛
+ - `runtime-config.js`(容器启动时写入真实外部端口)存在脚本加载竞态与缓存,浏览器回退到构建期默认端口,使 `WS_EXTERNAL_PORT` 看似无效。现以 `beforeInteractive` 加载该脚本、对其设置 `no-store` 且排除出 PWA 预缓存
+- **Mihomo 代理组被解析成规则**([#67],PR [#68] 由 @cesaryuan 贡献)🐛
+ - 规则名不再误用链路最后一跳(代理组),改用真实匹配规则,并集中到共享 `buildRuleName` helper,消除多写路径的逻辑漂移
+- **采集器静默挂起、数据停止同步**([#74],PR [#76] 由 @zj1123581321 贡献)🐛
+ - 新增 WebSocket 心跳看门狗:定期 ping 并跟踪最近活跃时间,链路静默超时则强制 terminate,触发既有重连逻辑,修复 TCP 静默断开(网关重启 / NAT 超时)导致的「连接仍在但数据停更」
+
+### 优化
+
+- **WebSocket 重连改为指数退避 + 抖动**:避免后端宕机 / 抖动时多个采集器每 5 秒同步重连造成的雪崩;连接成功后重置退避。Surge 采集器的退避重试也加入抖动(`WS_MAX_RECONNECT_INTERVAL_MS` 可配,默认 60s)
+
+[#61]: https://github.com/foru17/neko-master/issues/61
+[#65]: https://github.com/foru17/neko-master/issues/65
+[#67]: https://github.com/foru17/neko-master/issues/67
+[#68]: https://github.com/foru17/neko-master/pull/68
+[#74]: https://github.com/foru17/neko-master/issues/74
+[#76]: https://github.com/foru17/neko-master/pull/76
+
## [1.3.8] - 2026-06-10
### 修复
diff --git a/package.json b/package.json
index 5d5871e..d8cb888 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "neko-master",
- "version": "1.3.8",
+ "version": "1.3.9",
"description": "Modern traffic analytics for edge gateways",
"private": true,
"workspaces": [