{"success":true,"name":"set-a-timeout-on-every-network-request","description":"Code makes HTTP or socket calls with no time limit.","category":"ai-brimind","path":"ai-brimind/set-a-timeout-on-every-network-request/SKILL.md","file":"SKILL.md","content":"---\nname: set-a-timeout-on-every-network-request\ndescription: \"Code makes HTTP or socket calls with no time limit.\"\n---\n\n# Set a Timeout on Every Network Request\n\n## When to use\nA fetch, API call, or connection is made and the code would wait forever (or minutes) if the other side hangs instead of failing.\n\n## Example request\nServer hangs without responding → the loading spinner runs forever; the user can't even retry — infinite wait. Backend calls a third-party API with no timeout → its own requests pile up waiting; the whole server clogs — one slow dependency blocks everything. Timeout exists but shows nothing → the request silently dies and the UI stays frozen — timeout without user feedback.\n\n## Instructions\nAct like a developer who knows 'no answer' is a common answer on networks. For every outgoing request: (1) set an explicit timeout suited to the operation — a few seconds for interactive calls, longer for known-heavy ones — using the platform's mechanism (AbortController with fetch, the HTTP client's timeout option, socket timeouts); an unbounded wait is a hang, not patience; (2) decide what happens ON timeout before writing it: show a retry-able error, fall back to cached data, or fail the operation loudly — a timeout that leads to a frozen UI solved nothing; (3) on servers, timeouts protect the whole system: one hanging dependency without a timeout can exhaust connections and take down unrelated endpoints. Distinguish timeout from other failures in logs ('timed out after 5000ms calling X') so slow-dependency patterns become visible. Only proceed once every external call has a stated time limit and a defined, user-visible consequence when it fires.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1089\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}