SShortSingh.
Back to feed

Go SSE Streams Break Silently Due to HTTP/2 Headers and Default Timeouts

0
·2 views

Server-Sent Events (SSE) in Go fail in two distinct ways before any application logic runs: first, because setting a Connection header is forbidden under HTTP/2 (RFC 9113), and second, because default server timeouts such as WriteTimeout and middleware context cancellation silently cut streams at 30 seconds. Both issues produce the same browser-side symptom — a net::ERR_HTTP2_PROTOCOL_ERROR and a reconnect loop — making the protocol appear at fault when the real cause is server configuration. A Go developer running SSE endpoints in production on Kubernetes traced both failures to a shared internal package that applied API-oriented defaults unsuitable for long-lived streams. The correct fix requires removing hop-by-hop headers entirely and overriding both the WriteTimeout and any context-cancelling middleware specifically for streaming paths. A related Go patch in August 2026 reinforced the same principle: a timeout only protects the connections it explicitly covers.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Claude AI Doubles Protein Design Success Rate in Lab-Validated Tests

Anthropic has published lab-validated results showing its Claude AI designed effective protein binders against 14 of 15 targets tested in collaboration with Adaptyv Bio and Twist Bioscience, achieving a 22–35% success rate compared to the industry norm of 10–15%. The model also analyzed raw spectroscopy data in under 25 minutes with accuracy matching laboratory readings. Despite these results, Anthropic has restricted life-science capabilities in its most advanced model and is developing a structured access program for vetted scientists before wider release. The company cites the dual-use nature of protein design — which can serve both medicine and potential harm — as the reason for building safety vetting processes ahead of launch. If successful, Anthropic's controlled-access approach could serve as a broader template for managing other high-risk AI capabilities as they emerge.

0
ProgrammingDEV Community ·

Why better products lose government contracts — and how to stop it

Enterprise procurement processes are designed to produce defensible, auditable decisions rather than to select the best-performing product, which systematically disadvantages innovative or newer vendors. Criteria are typically set months before a formal tender is issued, often shaped by incumbents who engaged early, leaving latecomers scored against a definition of the problem they had no part in writing. Qualitative advantages such as usability, superior support, or stronger long-term architecture are difficult to score objectively and are therefore discounted, while measurable proxies like company size and certifications dominate evaluations. The decision-maker in these processes is usually the person who bears accountability if a contract fails, so they prioritise risk mitigation over upside potential. Founders and sales teams that engage early, address failure scenarios explicitly, and treat pilot programmes as trust-building exercises rather than proof-of-concept victories are better positioned to win.

0
ProgrammingDEV Community ·

LinkedIn's AI Slop Button Hit 1M Reports in Two Weeks, Exposing Deeper Web Quality Crisis

LinkedIn introduced a 'Seems like AI slop' reporting option on posts, which users clicked over one million times within its first two weeks, signalling widespread frustration with low-value content in feeds. The company's chief product officer confirmed the figure reflects total reports, not verified AI-generated posts or unique users. While most users view the issue as a social media moderation problem, developers building search engines and AI applications face a more fundamental challenge: the web can host millions of pages without containing millions of distinct, reliable facts. Experts caution that AI authorship is an unreliable proxy for content quality, since human-written articles can be hollow while AI-assisted ones may contain original research and verified sources. Separately, Anthropic announced that Claude models released on or after August 2, 2026 will embed machine-readable provenance markings in generated text, approaching the transparency problem from the content-creation side.

0
ProgrammingDEV Community ·

Why MCP Protocol Cannot Enforce Business Logic or Authorization Decisions

The Model Context Protocol (MCP) provides a standardized way for AI agents to discover and invoke tools across systems, solving a real interoperability problem in connecting applications to APIs and databases. However, MCP's design does not address whether a requested business action is actually authorized under organizational policy — only whether the technical connection and input schema are valid. In a practical example, an agent executing an employee offboarding request may successfully call the correct tool with valid arguments, yet still act prematurely if it cannot verify who holds authority over the termination time. Production workflows typically involve multiple distinct identities — requester, actor, subject, and approver — and collapsing these roles leads to misleading audit trails regardless of whether OAuth tokens are used correctly. Business rules, policy enforcement, and multi-party authorization must therefore be layered on top of MCP by the surrounding system, not assumed to be handled by the protocol itself.