Skip to content

Conversation

@jasikpark
Copy link

@jasikpark jasikpark commented Nov 5, 2025

Description

Adds header x-wails-window-name to asset server requests, so that they can be logged.

https://github.com/jasikpark/wails/blob/eb3a7e53925d9c755afc312f1579219f8497d61f/v3/internal/assetserver/assetserver.go#L72-L80

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I haven't tested this, but it should be possible to test by running a wails app and loading a webview window, and looking in the logs for logs like:

   dnclient-desktop: [net.defined.dnclient-desktop:go] time="2025-11-04T17:20:16-06:00" level=info msg="Asset Request:" code=200 duration="267.625µs" method=GET path=/assets/appicon-DeEhA_aB.png subsystem=ui windowID=1 windowName=

where instead, the log contains the window name:

   dnclient-desktop: [net.defined.dnclient-desktop:go] time="2025-11-04T17:20:16-06:00" level=info msg="Asset Request:" code=200 duration="267.625µs" method=GET path=/assets/appicon-DeEhA_aB.png subsystem=ui windowID=1 windowName="About"
  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

macOS 26.1

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Window name information can now be properly logged alongside window ID for improved debugging and tracking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Added the window name to request headers in the webViewAssetRequest to enable logging with the window ID. This includes a corresponding changelog entry documenting the fix.

Changes

Cohort / File(s) Summary
Documentation
v3/UNRELEASED_CHANGELOG.md
Added Fixed section entry documenting the addition of missing window name to request headers for logging
Request Header Enhancement
v3/pkg/application/application.go
Set x-wails-window-name header in webViewAssetRequest.Header using the application's window name

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

Bug, go, size:M

Poem

🐰 A window name now travels through the air,
In headers dressed, so loggers see it there,
No more ID mysteries, just clarity—
One little fix, pure simplicity!

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the main purpose and includes testing notes, but lacks an explicit issue reference and has several unchecked checklist items including tests and documentation.
Title check ✅ Passed The title directly describes the main change: adding the window name as a header to the AssetFileServer, which matches the core modification in application.go.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jasikpark jasikpark changed the base branch from master to v3-alpha November 5, 2025 00:14
@github-actions github-actions bot added Documentation Improvements or additions to documentation v3-alpha labels Nov 5, 2025
@jasikpark jasikpark marked this pull request as ready for review November 5, 2025 00:15
@jasikpark
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@jasikpark jasikpark changed the title Window name Ensure the window name is passed as header to AssetFileServer Nov 5, 2025
@jasikpark jasikpark changed the title Ensure the window name is passed as header to AssetFileServer [v3] Ensure the window name is passed as header to AssetFileServer Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation v3-alpha

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant