mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-28 17:23:47 +00:00
Add an application-layer CatalogCommitCoordinator as the single commit entry for normal configuration changes: copy -> mutate -> atomic persist -> publish committed state -> async runtime convergence toward the just committed in-memory snapshot. Commits complete at persist; convergence reports structured outcomes (converged / revalidated / failed / clearedAndStopped) and never blocks or rolls back the commit. Each commit bumps a generation; superseded syncs end before starting or have their late results discarded, so only the latest snapshot can win. No automatic retry. CatalogRuntimeSyncing is the one new replacement seam: the production ProxyRuntimeSyncAdapter drives the existing ProxyRuntimeController via a snapshot-based catalogDidCommit; tests use a deterministic fake. When no active target exists a commit no longer touches the runtime at all. CatalogViewModel stays as a compatibility facade with unchanged published state; the optional postCommit callback and the per-scene callback wiring in MainApp are removed - the composition root wires the coordinator, adapter and the (independent) Legacy import boundary exactly once.