"The cleanest design in the world loses to a four-year-old platform bug. When the platform says no, you don't argue — you find the door that's actually open."
The Plan That Should Have Worked
The clean design was push everywhere: a secure WebSocket from the plugin to the backend, a secure WebSocket from the workspace to the backend, real-time bidirectional messaging across the board. WebSockets are the right tool for live, pushy, low-latency communication, and the architecture was elegant. Then the plugin's outbound secure WebSocket simply didn't connect — on the target operating system, it failed silently, with no server-side connection attempt and no useful error.
The Diagnosis: It's Not You, It's the Platform
A spike isolated the cause: the plugin sandbox on that OS rejects outbound secure WebSocket connections entirely, at a layer below the application's control. It wasn't a bug in the code, a wrong flag, or a missing permission — it was a long-standing, still-open platform-level defect, documented in a vendor issue that had been open for years. No amount of clever client code would fix it, because the failure was happening below where any client code could reach.
The Door That Was Open
The same spike confirmed the way through: while the plugin's secure WebSocket was blocked, the plugin's HTTPS requests worked perfectly normally. So the bridge between plugin and backend moved off WebSocket and onto HTTPS request/response. The plugin POSTs its captures and state to the backend; for backend-to-plugin messages, the plugin holds open a long-poll request that the backend answers the instant it has a command. That preserves push-like delivery over plain request/response plumbing.
Hybrid, Not Uniform
The result is deliberately asymmetric: the plugin-to-backend link is HTTPS (because that's what works there), while the workspace-to-backend link stays a secure WebSocket (because that works fine there). Two links, two transports, each chosen for its actual environment rather than forced into one uniform answer. The temptation to make everything the same transport for tidiness is exactly the wrong instinct when the environments genuinely differ.
Leave the Door Marked for the Future
One last discipline: the workaround is documented as a workaround, tied to the specific platform bug, with a note not to reintroduce the blocked transport without re-running the spike. The bug might be fixed in a future platform release — and when it is, you want to know exactly why the hybrid exists and how to test whether you can simplify back. A workaround with no memory of why it exists becomes permanent cruft nobody dares touch.