fix(channel-monitor-v2): default mode v1 and gentle adaptive backfill

Default channel_monitor_mode to v1 (opt-in V2) so upgrades keep active
probes; existing explicit v2 rows are left alone via ON CONFLICT DO NOTHING
plus migration checksum compatibility for already-applied 195.

V2 first-enable backfill no longer compresses ticks to 5s or uses 24h
chunks. Each tick does recent overlap plus at most one historical chunk
with depth-based ceilings (2h/4h/6h), adaptive grow/shrink, and failure
backoff. Error request_id dedup is bounded by a 90-minute lookback so
ops_error_logs is not scanned for full history.

Also align hide_throughput parse default with privacy-preserving public
runtime (missing key → true).
This commit is contained in:
IanShaw027
2026-08-08 13:59:11 +08:00
parent a4faa015a7
commit 825f9c78d5
16 changed files with 262 additions and 62 deletions
+2 -2
View File
@@ -160,11 +160,11 @@ export function isChannelMonitorRouteEnabled(): boolean {
export type ChannelMonitorMode = 'v1' | 'v2'
/** Exclusive channel-monitor implementation. Invalid/missing → v2. */
/** Exclusive channel-monitor implementation. Invalid/missing → v1 (opt-in to v2). */
export function getChannelMonitorMode(): ChannelMonitorMode {
const appStore = useAppStore()
const mode = appStore.cachedPublicSettings?.channel_monitor_mode
return mode === 'v1' ? 'v1' : 'v2'
return mode === 'v2' ? 'v2' : 'v1'
}
export function isChannelMonitorV1Mode(): boolean {