Electron IPC State Sync: The Part Nobody Warns You About
Building the Dopmin Web Scraper's Electron app meant learning the hard way that main/renderer process separation is a discipline, not a default.
Electron makes it deceptively easy to reach across the main/renderer boundary and just... call something. It works, right up until your app has real concurrent state — in the Dopmin Web Scraper's case, a query-expansion module scaling out permutations while a concurrent scraping engine is mid-run against dynamic web elements.
The failure mode is subtle: the renderer shows one version of "current progress," the main process has already moved past it, and now your UI is lying to the user by a few seconds — just enough to look broken without ever throwing an error.
The fix was treating IPC like an actual API contract instead of a convenient tunnel: typed message shapes, a single source of truth for state living in the main process, and the renderer only ever rendering what it was explicitly sent — never assuming, never polling ad hoc. Once that discipline was in place, adding encrypted local state persistence on top was straightforward, because the state was finally well-defined enough to serialize safely.
If you're building anything in Electron beyond a static shell, decide on your IPC contract before you write the first scraping job, not after the third race condition report.