Files
mirror-3x-ui/internal
Hamed be2a2e9e71 perf(nodes): scope expiry repair to activated clients (#7241)
Every node snapshot merge ran a table-wide UPDATE that copies a node-activated deadline onto client records still holding the start-after-first-use duration, whether or not that snapshot activated anyone.

A merge now repairs only the clients it activated or renewed in that tick, and a snapshot with no such transition issues no UPDATE. Older drift (legacy imports, a tick whose client reconciliation was skipped) is repaired by the five-minute maintenance job in windows of 4,000 client ids, which also covers standalone panels. A failed repair now fails the merge on SQLite as it always did on PostgreSQL, where the transaction was already aborted.

Verified on SQLite and PostgreSQL 18: the previous code rewrites an unrelated client's expiry on every merge, and without the scoped lift a record on a tick that cannot rebuild client records keeps its negative duration.

Fixes #7233
2026-11-29 18:12:13 +03:30
..
2026-10-25 20:08:14 +01:00