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
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:
applies to
acceptance