Skip to content

standard: SSE streams must have timeouts — no unbounded reads #40

@BryanChasko

Description

@BryanChasko

context

validate-moodle-goals.js SSE reader had no timeout — hung for 14 minutes in a real session. fixed with script-level 60s kill + per-read 30s Promise.race timeout

what

codify as a heraldstack engineering standard: every SSE/streaming read must be wrapped in Promise.race with a timeout. every script that consumes streams must have a hard kill timer

pattern:

var chunk = await Promise.race([
  reader.read(),
  new Promise(function(_, reject) {
    setTimeout(function() { reject(new Error('read timeout')); }, 30000);
  })
]);

applies to

  • any mino API SSE consumers
  • any MCP streaming responses
  • any long-running fetch() with streaming bodies

acceptance

  • standard documented in heraldstack engineering guide
  • existing SSE consumers audited and patched
  • lint rule or code review checklist item

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions