Skip to content

fix: keep empty part path#1321

Merged
andrinoff merged 1 commit into
floatpane:masterfrom
resolvicomai:fix/empty-part-path
May 21, 2026
Merged

fix: keep empty part path#1321
andrinoff merged 1 commit into
floatpane:masterfrom
resolvicomai:fix/empty-part-path

Conversation

@resolvicomai
Copy link
Copy Markdown
Contributor

@resolvicomai resolvicomai commented May 21, 2026

What?

Fixes #1113. formatPartPath now returns an empty string for nil/empty paths instead of silently formatting them as part 1. A regression test covers both nil and empty slices.

Why?

parsePartID already treats an empty string as the nil-path convention, while 1 is a real MIME part. Returning 1 for an empty walk path can mask caller bugs and fetch the wrong part.

Validation:

  • go test ./fetcher -run TestFormatPartPathEmptyPath -count=1
  • go test ./fetcher -count=1
  • go test ./...
  • make lint
  • git diff --check

@resolvicomai resolvicomai requested a review from a team as a code owner May 21, 2026 08:43
@floatpanebot floatpanebot added the area/fetcher IMAP fetch / IDLE / search 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 bug Something isn't working size/S Diff: 11–50 lines labels May 21, 2026
@resolvicomai resolvicomai changed the title fix(fetcher): preserve empty part path fix: keep empty part path May 21, 2026
@floatpanebot floatpanebot dismissed their stale review May 21, 2026 08:45

Formatting issues have been resolved. Thank you!

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

@andrinoff andrinoff merged commit ca85147 into floatpane:master May 21, 2026
18 of 19 checks passed
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 bug Something isn't working size/S Diff: 11–50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: formatPartPath silently maps empty path to '1'

4 participants