Skip to content

[v3] bugfix/windows linux notifications - #4450

Merged
leaanthony merged 4 commits into
wailsapp:v3-alphafrom
popaprozac:v3-alpha-bugfix/windows-linux-notifications
Jul 30, 2025
Merged

leaanthony merged 4 commits into
wailsapp:v3-alphafrom
popaprozac:v3-alpha-bugfix/windows-linux-notifications

Conversation

@popaprozac

@popaprozac popaprozac commented Jul 28, 2025 •

Copy link
Copy Markdown
Contributor

Description

This ensures Windows toast payloads are always encoded, regardless of Data property, to ensure decoding succeeds.

For timing issues detailed in #4449 open to suggestions. Not a bug in Windows or Linux but could lead to confusion.

Fixes #4449

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?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

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

Test Configuration

 Wails (v3.0.0-dev)  Wails Doctor

# System

┌─────────────────────────────────────────────────────────────────────────────────────────────┐
| Name              | Windows 10 Pro                                                          |
| Version           | 2009 (Build: 26100)                                                     |
| ID                | 24H2                                                                    |
| Branding          | Windows 11 Pro                                                          |
| Platform          | windows                                                                 |
| Architecture      | amd64                                                                   |
| Go WebView2Loader | true                                                                    |
| WebView2 Version  | 138.0.3351.109
              |
| CPU               | virt-9.1
              |
| GPU 1             | Red Hat VirtIO GPU DOD controller (Red Hat, Inc.) - Driver: 22.7.38.43  |
| Memory            | 8GB
              |
└─────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment

┌─────────────────────────────────────────────────────────┐
| Wails CLI    | v3.0.0-dev                               |
| Go Version   | go1.24.5                                 |
| Revision     | d9a003b56ccde0241ab9467316781f06110e7bd2 |
| Modified     | true                                     |
| -buildmode   | exe                                      |
| -compiler    | gc                                       |
| CGO_ENABLED  | 0                                        |
| GOAMD64      | v1                                       |
| GOARCH       | amd64                                    |
| GOOS         | windows                                  |
| vcs          | git                                      |
| vcs.modified | true                                     |
| vcs.revision | d9a003b56ccde0241ab9467316781f06110e7bd2 |
| vcs.time     | 2025-07-25T22:26:56Z                     |
└─────────────────────────────────────────────────────────┘

# Dependencies

┌────────────────────────────────────────────┐
| MSIX Packaging Tool        | Not Installed |
| SignTool.exe (Windows SDK) | Not Installed |
| npm                        | 10.9.2        |
| NSIS                       | Not Installed |
| MakeAppx.exe (Windows SDK) | Not Installed |
|                                            |
└───────── * - Optional Dependency ──────────┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

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

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of notification payload encoding on Windows, ensuring consistent handling of notification data and actions.
    • Fixed notification parsing issues on Windows platforms for better notification delivery.

@coderabbitai

coderabbitai Bot commented Jul 28, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in the Windows notification service remove conditional checks for the presence of user data before encoding payloads. Now, payload encoding is always performed for both the main notification and its actions, regardless of whether user-supplied data is present. Error handling for encoding failures remains unchanged.

Changes

Cohort / File(s) Change Summary
Windows Notification Service
v3/pkg/services/notifications/notifications_windows.go
Always encodes payload for notifications and actions, removing conditional checks for Data field.
Changelog Update
v3/UNRELEASED_CHANGELOG.md
Added a bug fix entry for Windows notification parsing issues referencing contributor and PR.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix Windows notification service bug where notifications fail to decode payload if Data is nil (#4449) ✅ Payload encoding now always occurs regardless of Data being nil, fixing decode errors on Windows.
Ensure notification service usable immediately after creation on Windows without ServiceStartup (#4449) ❓ This change does not address ServiceStartup timing or initialization issues explicitly.
Fix Linux notification panic due to ServiceStartup timing (#4449) ❌ No changes to Linux notification service or ServiceStartup handling.

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Poem

A bug in the Windows toast,
Where empty Data caused a ghost.
Now all is encoded, nil or not,
Each action’s payload tied in a knot.
The service hops on, free from fright—
Notifications shining bright!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7fee7f and 45d6256.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • v3/UNRELEASED_CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
✨ Finishing Touches
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 28, 2025
@dosubot dosubot Bot added Bug Something isn't working v3 labels Jul 28, 2025
@popaprozac popaprozac changed the title [V3] bugfix/windows linux notifications [v3] bugfix/windows linux notifications Jul 28, 2025
@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Jul 28, 2025
@leaanthony
leaanthony enabled auto-merge (squash) July 30, 2025 12:30
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 30, 2025
@sonarqubecloud

Copy link
Copy Markdown

@leaanthony
leaanthony merged commit 48e3bd3 into wailsapp:v3-alpha Jul 30, 2025
Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
* fix windows encoding

---------

Co-authored-by: Lea Anthony <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. v3 Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants