Summary
app/src/App.tsx starts five service singletons at module evaluation time (startWebviewAccountService(), etc.). These attach Tauri listen<>() event handlers internally. During Vite HMR, module re-evaluation is guarded by started flags (preventing double-start), but orphaned listeners from the previous module instance are never cleaned up.
Impact
Low — Development-only: HMR accumulates orphaned event listeners, causing duplicate handler execution and potential memory leaks during hot reload cycles.
Suggested Fix
Export cleanup functions from each service and call them in import.meta.hot?.dispose():
if (import.meta.hot) {
import.meta.hot.dispose(() => {
stopWebviewAccountService();
stopWebviewNotificationsService();
// ...
});
}
Summary
app/src/App.tsxstarts five service singletons at module evaluation time (startWebviewAccountService(), etc.). These attach Taurilisten<>()event handlers internally. During Vite HMR, module re-evaluation is guarded bystartedflags (preventing double-start), but orphaned listeners from the previous module instance are never cleaned up.Impact
Low — Development-only: HMR accumulates orphaned event listeners, causing duplicate handler execution and potential memory leaks during hot reload cycles.
Suggested Fix
Export cleanup functions from each service and call them in
import.meta.hot?.dispose():