Skip to content

fix(cli): report output failures and retain saved request options - #41

Open
rupayon123 wants to merge 13 commits into
kavix:mainfrom
rupayon123:contribution/cli-output-errors-20260913
Open

rupayon123 wants to merge 13 commits into
kavix:mainfrom
rupayon123:contribution/cli-output-errors-20260913

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

Problem and change

A small formatted response could return success when the final buffered write failed. Check the final Flush error and return the existing CLI error path. A subprocess regression with a real HTTP test server and closed output destination reproduces the previous successful exit.

Saved requests also dropped JSON filters and HTTP/3 selection. Serialize and restore those fields so a saved request retains its behavior; a temporary-home round-trip regression covers the options together. Old files retain zero-value defaults for the new fields.

Validation

Both regressions failed before their respective fixes. Full env -u NO_COLOR go test ./..., go vet ./..., build, gofmt and git diff --check pass. The color-environment test issue is tracked separately in PR39. No merge or release is implied. Prepared with AI assistance.

@rupayon123

Copy link
Copy Markdown
Contributor Author

Additional fixes pushed to this branch:

  • fcb8234: Reject invalid GraphQL/SSE arguments before side effects.
  • 5b84ea3: Propagate GraphQL output flush failure.
  • 5298c5d: Send WebSocket messages larger than Scanner default limit.
  • 8ec0d67: Honor WebSocket connection and upgrade deadlines.
  • ff1e5f1: Recognize and connect uppercase or mixed-case WebSocket schemes.
  • b6de077: Reject corrupt, negative or overflowing saved-request timeouts.

Full Go tests, go vet and build pass. Subprocess and local-server regressions cover rejected arguments without requests, failed stdout flushing, 70 KiB WebSocket input, a stalled handshake timeout, mixed-case schemes and invalid saved timeouts. Today's changes have no new findings under golangci-lint v2.13.2 using a migrated copy of the repository configuration. This is a scoped lint result: a full CLI-branch scan still reports 93 findings outside today's changes; the legacy v1 linter cannot read the installed Go 1.27 export format.

Prepared with AI assistance. Changes are submitted for review; this is not a claim of maintainer approval.

@rupayon123

Copy link
Copy Markdown
Contributor Author

September 16 verified update:

WebSocket receive and stdout failures now exit unsuccessfully; successful headers-only requests close their unread HTTP response body. Each has a regression that failed before the corresponding fix. The final full Go suite, vet, build and scoped lint pass. Closing via defer covers returning paths; fatal process exit still relies on process cleanup. A separate test-cleanup lint correction is included in the branch.

Commits: ce329b901c6791c93248e9fa9480b321a4384ad9, 80b710f44e98ed89924775694b749f1a2002f8b0, 97f9ae151a933bb7f965731b9fad3ecb7d5a3f1e.

Exact current head: 97f9ae151a933bb7f965731b9fad3ecb7d5a3f1e. GitHub checks at this read: build: SUCCESS. Local results do not imply maintainer approval.

AI-assisted with OpenAI Codex; changes and validation were inspected before submission.

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.

1 participant