When a macOS desktop app refuses to restart — LaunchServices and the Flask-server pattern
WP Maintenance Manager ships as a desktop app with an unusual structure under the hood: a local Flask server with a browser-rendered UI. Double-clicking the app icon starts the server, opens the user’s default browser at http://127.0.0.1:<port>/, and the management UI lives in that tab. The pattern fits well for tools that need rich admin UIs without the complexity of a full Electron build, and it lets us reuse standard web stack assets. Once the app reached real users on macOS, however, we got a recurring report: “I closed the browser tab, and now the app won’t restart.” The investigation led us not to a code bug, but to a …