-
Notifications
You must be signed in to change notification settings - Fork 0
fix: a few regressions from previous PRs #10
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: qodo_full_base_fix_a_few_regressions_from_previous_prs_pr10
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 |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ | |
| pub(crate) mod plugin; | ||
| mod webview_window; | ||
|
|
||
| use cookie::Cookie; | ||
| pub use webview_window::{WebviewWindow, WebviewWindowBuilder}; | ||
|
|
||
| /// Cookie crate used for [`Webview::set_cookie`] and [`Webview::delete_cookie`]. | ||
|
|
@@ -20,6 +19,8 @@ use http::HeaderMap; | |
| use serde::Serialize; | ||
| use tauri_macros::default_runtime; | ||
| pub use tauri_runtime::webview::{NewWindowFeatures, PageLoadEvent}; | ||
| // Remove this re-export in v3 | ||
| pub use tauri_runtime::Cookie; | ||
|
Comment on lines
+22
to
+23
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. 1. cookie re-export lacks docs • pub use tauri_runtime::Cookie; is a public API surface but is preceded only by a non-doc comment, so it will not appear in generated docs. • This violates the requirement that public API elements include /// documentation comments, reducing discoverability and increasing downstream confusion. Agent prompt
|
||
| #[cfg(desktop)] | ||
| use tauri_runtime::{ | ||
| dpi::{PhysicalPosition, PhysicalSize, Position, Size}, | ||
|
|
@@ -521,7 +522,7 @@ tauri::Builder::default() | |
| "opened-window", | ||
| tauri::WebviewUrl::External("about:blank".parse().unwrap()), | ||
| ) | ||
| .with_window_features(features) | ||
| .window_features(features) | ||
| .on_document_title_changed(|window, title| { | ||
| window.set_title(&title).unwrap(); | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,7 +297,7 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> { | |
| /// "opened-window", | ||
| /// tauri::WebviewUrl::External("about:blank".parse().unwrap()), | ||
| /// ) | ||
| /// .with_window_features(features) | ||
| /// .window_features(features) | ||
| /// .on_document_title_changed(|window, title| { | ||
| /// window.set_title(&title).unwrap(); | ||
| /// }) | ||
|
|
@@ -1312,13 +1312,13 @@ impl<R: Runtime, M: Manager<R>> WebviewWindowBuilder<'_, R, M> { | |
| target_os = "netbsd", | ||
| target_os = "openbsd" | ||
| ))] | ||
| pub fn with_window_features(mut self, features: NewWindowFeatures) -> Self { | ||
| if let Some(position) = features.position() { | ||
| self.window_builder = self.window_builder.position(position.x, position.y); | ||
| pub fn window_features(mut self, features: NewWindowFeatures) -> Self { | ||
|
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. 6. Semver-breaking api rename • WebviewWindowBuilder::with_window_features was removed/renamed to window_features without keeping a deprecated alias. • In tauri v2.7.0, removing a public method in a minor release is a semver-breaking change that will break downstream crates at compile time. • If this rename is intentional, it should be introduced via a deprecated wrapper and removed in v3, not v2.x. Agent prompt
|
||
| if let Some(size) = features.size() { | ||
| self.window_builder = self.window_builder.inner_size(size.width, size.height); | ||
| } | ||
|
|
||
| if let Some(size) = features.size() { | ||
| self.window_builder = self.window_builder.inner_size(size.width, size.height); | ||
| if let Some(position) = features.position() { | ||
| self.window_builder = self.window_builder.position(position.x,position.y); | ||
| } | ||
|
Comment on lines
+1315
to
1322
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. 2. window_features rustfmt violations • The new implementation contains spacing inconsistencies (extra spaces and missing spaces after commas) that cargo fmt would rewrite. • This likely causes cargo fmt --all -- --check to fail, violating formatting compliance and creating noisy diffs. Agent prompt
|
||
|
|
||
| #[cfg(target_os = "macos")] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,6 @@ mod menu_plugin; | |
| #[cfg(desktop)] | ||
| mod tray; | ||
|
|
||
| use std::sync::atomic::AtomicUsize; | ||
|
|
||
| use serde::Serialize; | ||
| use tauri::{ | ||
| ipc::Channel, | ||
|
|
@@ -68,40 +66,40 @@ pub fn run_app<R: Runtime, F: FnOnce(&App<R>) + Send + 'static>( | |
| .build()?, | ||
| )); | ||
|
|
||
| let app_ = app.handle().clone(); | ||
|
|
||
| let mut created_window_count = AtomicUsize::new(0); | ||
| let mut window_builder = WebviewWindowBuilder::new(app, "main", WebviewUrl::default()) | ||
| .on_new_window(move |url, features| { | ||
| println!("new window requested: {url:?} {features:?}"); | ||
|
|
||
| let number = created_window_count.fetch_add(1, std::sync::atomic::Ordering::Relaxed); | ||
|
|
||
| let builder = tauri::WebviewWindowBuilder::new( | ||
| &app_, | ||
| format!("new-{number}"), | ||
| tauri::WebviewUrl::External("about:blank".parse().unwrap()), | ||
| ) | ||
| .with_window_features(features) | ||
| .on_document_title_changed(|window, title| { | ||
| window.set_title(&title).unwrap(); | ||
| }) | ||
| .title(url.as_str()); | ||
|
|
||
| let window = builder.build().unwrap(); | ||
| tauri::webview::NewWindowResponse::Create { window } | ||
| }) | ||
| .on_document_title_changed(|_window, title| { | ||
| println!("document title changed: {title}"); | ||
| }); | ||
|
|
||
| #[cfg(all(desktop, not(test)))] | ||
| { | ||
| let app_ = app.handle().clone(); | ||
| let mut created_window_count = std::sync::atomic::AtomicUsize::new(0); | ||
|
|
||
| window_builder = window_builder | ||
| .title("Tauri API Validation") | ||
| .inner_size(1000., 800.) | ||
| .min_inner_size(600., 400.) | ||
| .menu(tauri::menu::Menu::default(app.handle())?); | ||
| .menu(tauri::menu::Menu::default(app.handle())?) | ||
| .on_new_window(move |url, features| { | ||
| println!("new window requested: {url:?} {features:?}"); | ||
|
|
||
|
Comment on lines
70
to
+86
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. 4. println! logs url/title • The new code logs url, features, and document title using println!, which is unstructured and may include sensitive or user-controlled data. • This violates the secure logging requirement (structured logging and no sensitive data in logs), and also makes log ingestion/monitoring harder. Agent prompt
|
||
| let number = created_window_count.fetch_add(1, std::sync::atomic::Ordering::Relaxed); | ||
|
|
||
| let builder = tauri::WebviewWindowBuilder::new( | ||
| &app_, | ||
| format!("new-window-{number}"), | ||
| tauri::WebviewUrl::External("about:blank".parse().unwrap()), | ||
| ) | ||
| .window_features(features) | ||
| .on_document_title_changed(|window, title| { | ||
| window.set_title(&title).unwrap(); | ||
| }) | ||
| .title(url.as_str()); | ||
|
|
||
| let window = builder.build().unwrap(); | ||
| tauri::webview::NewWindowResponse::Create { window } | ||
|
Comment on lines
+89
to
+101
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. 3. builder.build() uses unwrap() • The new on_new_window handler uses multiple unwrap() calls (parse().unwrap(), set_title(...).unwrap(), builder.build().unwrap()), which can panic at runtime. • This violates the requirement to avoid panicking for fallible operations and to handle errors with meaningful context and graceful behavior. Agent prompt
|
||
| }); | ||
| } | ||
|
|
||
| let webview = window_builder.build()?; | ||
|
|
||
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.
5. Delete_cookie sets cookie
🐞 Bug✓ CorrectnessAgent prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools