-
Notifications
You must be signed in to change notification settings - Fork 0
fix(OPENFRAM-003-13): CU-86akdyq31 2 review findings in windows_activator.rs #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,14 @@ | |
| // what toasts are posted under) but has no property for the activator. The | ||
| // AppUserModelId key supplies it, and doubles as the AUMID registration for dev | ||
| // builds, which have no shortcut at all. | ||
| // | ||
| // This whole file is Windows-only: it is registered from `lib.rs` behind | ||
| // `#[cfg(target_os = "windows")]` on the `mod windows_activator;` declaration, | ||
| // which is what keeps the `windows` crate dependency and every item below out | ||
| // of non-Windows builds. The guard is asserted here too so this file cannot | ||
| // silently compile (and fail) on another platform if that `mod` guard is ever | ||
| // removed or edited. | ||
| #![cfg(target_os = "windows")] | ||
|
|
||
| use std::ffi::c_void; | ||
| use std::sync::OnceLock; | ||
|
|
@@ -64,6 +72,7 @@ static ROUTER: OnceLock<AppHandle> = OnceLock::new(); | |
| /// nothing, so COM never routes an activation into one that is about to exit. | ||
| pub(crate) fn init(app: &AppHandle) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Silent no-op when ROUTER.set fails in windows_activator::init leaves activator unregistered without any log In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| if ROUTER.set(app.clone()).is_err() { | ||
| log::warn!("[notifications] toast activator router already initialized β skipping re-init"); | ||
| return; | ||
| } | ||
| register(app); | ||
|
|
@@ -287,3 +296,4 @@ impl IClassFactory_Impl for ActivatorFactory_Impl { | |
| Ok(()) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π΄ windows_toast.rs post()/show()/ensure_logo() reference windows_activator::Press and windows crate types without a matching #[cfg(target_os = "windows")] on the call sites in the truncated activation-routing section
Added a module-level
#![cfg(target_os = "windows")]inner attribute at the top ofsrc-tauri/src/windows_activator.rs(just above theusestatements), along with an explanatory comment. This makes the file itself compile to nothing on non-Windows targets regardless of howlib.rsgates themod windows_activator;declaration, directly addressing the cross-platform-build risk. This is the smallest in-file change possible; it does not touchlib.rs, so iflib.rsalready double-gates the module this becomes a harmless redundant guard, and if it does not, this guard alone now prevents the compile failure. A maintainer should still verifylib.rs'smodattribute matches project convention (rule OPENFRAM-003-13), since a mismatch between#![cfg]here and themoddeclaration's own cfg is not something this file alone can fully reconcile (e.g. items re-exported from this module used elsewhere without matching guards could still fail elsewhere).π€ Prompt for AI agents
fix confidence: π΄ 55 low β review closely β react π/π to teach the reviewer