Skip to content

fix(tui): log debug file errors#1317

Closed
resolvicomai wants to merge 3 commits into
floatpane:masterfrom
resolvicomai:fix/kitty-log-write-close
Closed

fix(tui): log debug file errors#1317
resolvicomai wants to merge 3 commits into
floatpane:masterfrom
resolvicomai:fix/kitty-log-write-close

Conversation

@resolvicomai
Copy link
Copy Markdown
Contributor

@resolvicomai resolvicomai commented May 21, 2026

What?

  • Route debug image protocol log writes through a helper that checks write and close errors.
  • Log failures for DEBUG_IMAGE_PROTOCOL_LOG and DEBUG_KITTY_LOG instead of silently ignoring them.
  • Add regression coverage for write and close failure paths.

Closes #698
Closes #699

Why?

The Kitty/image protocol debugger previously ignored both WriteString and Close errors when writing debug logs, which could hide failed diagnostics and resource cleanup problems.

Tests

  • go test ./view -count=1 -run TestDebugImageProtocolReportsLog
  • go test ./view -count=1
  • go test ./...
  • make lint

@resolvicomai resolvicomai requested a review from a team as a code owner May 21, 2026 04:59
@floatpanebot floatpanebot added the bug Something isn't working label May 21, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @resolvicomai! Please fix the following issues with your PR:

  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added area/tui Terminal UI / view layer size/M Diff: 51–200 lines labels May 21, 2026
@resolvicomai resolvicomai changed the title fix(tui): report debug log file errors fix(tui): log debug file errors May 21, 2026
@floatpanebot floatpanebot added the chore Maintenance, refactor, cleanup label May 21, 2026
@floatpanebot floatpanebot dismissed their stale review May 21, 2026 05:00

Formatting issues have been resolved. Thank you!

Comment thread view/html.go
Comment thread view/html.go
@floatpanebot floatpanebot added area/fetcher IMAP fetch / IDLE / search size/L Diff: 201–800 lines labels May 21, 2026
FromSi
FromSi previously approved these changes May 21, 2026
Copy link
Copy Markdown
Member

@FromSi FromSi left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

@resolvicomai we are migrating to a new log introduced in #1311. Please use loglevels internal package

@andrinoff andrinoff removed the size/M Diff: 51–200 lines label May 21, 2026
@resolvicomai
Copy link
Copy Markdown
Contributor Author

Thanks. I pushed a follow-up that routes both debug-log paths through the internal loglevel package:

  • image protocol debug output and file-error logging in view/html.go
  • kitty body-selection output and file-error logging in fetcher/fetcher.go

Validation:

  • go test ./view ./fetcher
  • go test ./...
  • make lint
  • git diff --check

@andrinoff
Copy link
Copy Markdown
Member

conflicts @resolvicomai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fetcher IMAP fetch / IDLE / search area/tui Terminal UI / view layer bug Something isn't working chore Maintenance, refactor, cleanup size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Unchecked file close error in Kitty protocol debugger BUG: Unchecked file write error in Kitty protocol debugger

4 participants