Skip to content

fix: avoid web embed build failures#391

Merged
chenhg5 merged 1 commit intochenhg5:mainfrom
yzlu0917:codex/fix-web-embed-wecom-tests
Apr 2, 2026
Merged

fix: avoid web embed build failures#391
chenhg5 merged 1 commit intochenhg5:mainfrom
yzlu0917:codex/fix-web-embed-wecom-tests

Conversation

@yzlu0917
Copy link
Copy Markdown
Contributor

Summary

  • stop treating a missing web/dist/index.html as a hard build failure
  • keep web builds optional by shipping web/dist/.keep and only registering embedded
    assets when a real frontend bundle is present
  • fix WeCom inbound file MIME detection so generic .bin names still fall through to
    magic-byte sniffing

Why

A fresh source checkout could fail go test ./... and go build ./... because web/ embed.go required web/dist build artifacts to exist at compile time. Separately,
WeCom inbound file MIME detection returned application/octet-stream too early for
unknown extensions like .bin, which broke PNG detection by content.

Validation

  • installed a compatible Go toolchain (go1.26.1) for this environment
  • ran go test ./...

Copy link
Copy Markdown
Owner

@chenhg5 chenhg5 left a comment

Choose a reason for hiding this comment

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

LGTM. Practical fix for build and file handling.

Review summary:

  • ✅ Makes web/dist optional (no hard build failure without frontend bundle)
  • ✅ Adds .keep to gitignore exception
  • ✅ Improves WeCom MIME detection with magic-byte sniffing
  • ✅ CI passes

Good fix for fresh checkout builds and WeCom file handling.

@chenhg5 chenhg5 merged commit 68dcb10 into chenhg5:main Apr 2, 2026
5 checks passed
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.

2 participants