Skip to content

fix: resolve timeout lifecycle and remove forced CLI exit#158

Merged
iamfj merged 5 commits intonextfrom
feat/issue-157-timeout-lifecycle
Apr 22, 2026
Merged

fix: resolve timeout lifecycle and remove forced CLI exit#158
iamfj merged 5 commits intonextfrom
feat/issue-157-timeout-lifecycle

Conversation

@iamfj
Copy link
Copy Markdown
Member

@iamfj iamfj commented Apr 22, 2026

What does this PR do?

Fixes timeout lifecycle in GraphQL requests and removes forced process exit so CLI exits naturally after work completes.

Closes #157

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Tests
  • Build / CI

Checklist

  • npm run check:ci passes (lint + format)
  • npx tsc --noEmit passes (type check)
  • npm test passes (unit tests)
  • New code has tests (happy path + primary error case)
  • Commit messages follow Conventional Commits

Testing

  • npx vitest run tests/unit/client/graphql-client.test.ts
  • npm run check:ci
  • npx tsc --noEmit
  • npm test
  • npm run build
  • node dist/main.js usage > /tmp/linearis-usage.txt

Notes for reviewers

  • Removed global program.hook(\"postAction\", () => process.exit(0)); workaround.
  • GraphQLClient.request() now creates timeout handle per retry attempt and always clears it in finally.
  • Added regression tests asserting no pending timers on success, non-retryable error, and retry-success paths.

@iamfj iamfj force-pushed the feat/issue-157-timeout-lifecycle branch from 5ab1ef4 to 4dd932e Compare April 22, 2026 14:16
@iamfj
Copy link
Copy Markdown
Member Author

iamfj commented Apr 22, 2026

@eveld if you want give this a shot: could you check whether this also fixes your initial issue?

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ab1ef4590

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client/graphql-client.ts Outdated
@iamfj iamfj changed the base branch from main to next April 22, 2026 14:30
@eveld
Copy link
Copy Markdown
Contributor

eveld commented Apr 22, 2026

Confirmed — this fixes the 30s hang from #156.

Tested locally by building the branch and timing linearis projects list --limit 1:

The clearTimeout in the finally block is the proper fix. The dangling setTimeout was what kept the event loop alive, not the HTTP keep-alive as I initially assumed.

Pass AbortController signal to Linear SDK client per attempt so timeouts cancel in-flight fetches.

Add regression test for timeout abort behavior and timer cleanup.
@iamfj iamfj merged commit 980156b into next Apr 22, 2026
9 checks passed
@iamfj iamfj deleted the feat/issue-157-timeout-lifecycle branch April 22, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: replace global process.exit workaround with GraphQL timeout lifecycle fix

2 participants