Skip to content

fix: a few regressions from previous PRs#23

Open
tomerqodo wants to merge 5 commits intoqodo_combined_20260121_qodo_grep_cursor_copilot_1_base_fix_a_few_regressions_from_previous_prs_pr170from
qodo_combined_20260121_qodo_grep_cursor_copilot_1_head_fix_a_few_regressions_from_previous_prs_pr170
Open

fix: a few regressions from previous PRs#23
tomerqodo wants to merge 5 commits intoqodo_combined_20260121_qodo_grep_cursor_copilot_1_base_fix_a_few_regressions_from_previous_prs_pr170from
qodo_combined_20260121_qodo_grep_cursor_copilot_1_head_fix_a_few_regressions_from_previous_prs_pr170

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#170

@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (5) 📎 Requirement gaps (0)

Grey Divider


Action required

1. window_features not rustfmt-formatted 📘 Rule violation ✓ Correctness
Description
• The new window_features implementation contains irregular spacing (multiple spaces after commas
  and missing spaces after commas), which indicates cargo fmt would change the file.
• This violates the requirement that Rust code must already match the project’s rustfmt
  configuration and pass cargo fmt --check without modifications.
Code

crates/tauri/src/webview/webview_window.rs[R1316-1322]

+    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);
    }
Evidence
PR Compliance ID 9 requires Rust code to pass cargo fmt --check. The added lines show spacing that
rustfmt would normalize (e.g., extra spaces and missing spaces after commas), indicating the file is
not formatted per rustfmt.

AGENTS.md
crates/tauri/src/webview/webview_window.rs[1315-1322]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`window_features` contains spacing that likely fails the repository's rustfmt check.

## Issue Context
The code includes extra spaces after a comma and missing spaces after commas; rustfmt would reformat these lines.

## Fix Focus Areas
- crates/tauri/src/webview/webview_window.rs[1315-1322]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Cookie re-export undocumented 📘 Rule violation ✧ Quality
Description
• The PR introduces a new public re-export pub use tauri_runtime::Cookie; without an accompanying
  /// documentation comment.
• This makes the public API harder to understand and violates the requirement that public API
  elements include documentation comments.
Code

crates/tauri/src/webview/mod.rs[R22-23]

+// Remove this re-export in v3
+pub use tauri_runtime::Cookie;
Evidence
PR Compliance ID 13 requires documentation comments for public APIs. `pub use
tauri_runtime::Cookie; is a public API surface area but is only preceded by a non-doc //` comment,
not /// docs.

AGENTS.md
crates/tauri/src/webview/mod.rs[21-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A public re-export (`pub use tauri_runtime::Cookie;`) was added without Rust doc comments.

## Issue Context
Public API items should be self-documented for downstream users and docs generation.

## Fix Focus Areas
- crates/tauri/src/webview/mod.rs[21-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. delete_cookie sets cookie 🐞 Bug ✓ Correctness
Description
WryWebviewDispatcher::delete_cookie dispatches WebviewMessage::SetCookie instead of
  WebviewMessage::DeleteCookie, so callers cannot delete cookies anymore.
• This is a behavior regression: the runtime event loop still has a dedicated DeleteCookie branch
  that calls webview.delete_cookie, but it is never reached from delete_cookie.
• Impact: any code using Webview::delete_cookie will silently behave incorrectly (cookie
  persists/gets overwritten instead of removed).
Code

crates/tauri-runtime-wry/src/lib.rs[R1715-1721]

      Message::Webview(
        *self.window_id.lock().unwrap(),
        self.webview_id,
-        WebviewMessage::DeleteCookie(cookie.clone().into_owned()),
+        WebviewMessage::SetCookie(cookie.into_owned()),
      ),
    )?;
    Ok(())
Evidence
The dispatcher method delete_cookie sends WebviewMessage::SetCookie(...) (wrong variant), while
WebviewMessage defines a DeleteCookie variant and the message loop has a DeleteCookie handler
that correctly calls webview.delete_cookie(&cookie). This mismatch proves the delete API is broken
and the intended deletion pathway is bypassed.

crates/tauri-runtime-wry/src/lib.rs[1712-1721]
crates/tauri-runtime-wry/src/lib.rs[1401-1412]
crates/tauri-runtime-wry/src/lib.rs[3731-3741]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`WryWebviewDispatcher::delete_cookie` currently dispatches `WebviewMessage::SetCookie`, making `delete_cookie` behave like `set_cookie` and preventing cookie deletion.

### Issue Context
`WebviewMessage` includes a `DeleteCookie` variant and the message loop handles it by calling `webview.delete_cookie(&cookie)`, but the dispatcher never sends that variant.

### Fix Focus Areas
- crates/tauri-runtime-wry/src/lib.rs[1712-1721]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. New code uses unwrap() 📘 Rule violation ⛯ Reliability
Description
• The added example code uses unwrap() on fallible operations (parse(), set_title, and
  build()), which can panic at runtime and hides error context.
• The compliance requirement calls for returning/propagating Result for fallible operations rather
  than panicking, especially where failures should be handled gracefully.
Code

examples/api/src-tauri/src/lib.rs[R92-101]

+              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 }
Evidence
PR Compliance ID 22 requires fallible operations to return Result rather than panicking via
unwrap()/expect(). The added example handler uses unwrap() multiple times on fallible
operations (parse, set_title, build).

AGENTS.md
examples/api/src-tauri/src/lib.rs[89-101]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new code panics via `unwrap()` on operations that can fail.

## Issue Context
Panics reduce robustness and remove useful context. Prefer `Result` propagation and explicit handling.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[89-101]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. println! logs URL/features 📘 Rule violation ⛨ Security
Description
• The new example logs url and features via println!, which is unstructured and may
  inadvertently expose sensitive data contained in URLs (e.g., query parameters or tokens).
• Secure logging practices require logs to avoid sensitive data and be structured for
  auditing/monitoring.
Code

examples/api/src-tauri/src/lib.rs[R84-86]

+          .on_new_window(move |url, features| {
+            println!("new window requested: {url:?} {features:?}");
+
Evidence
PR Compliance ID 5 requires structured logs and forbids logging sensitive data. Logging a full url
(even in examples) risks printing secrets embedded in URLs and is unstructured (println!).

Rule 5: Generic: Secure Logging Practices
examples/api/src-tauri/src/lib.rs[84-86]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new handler logs potentially sensitive URL data using unstructured `println!` output.

## Issue Context
URLs can contain secrets in query params/fragments; logs should be structured and avoid sensitive content.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[84-86]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. app_ variable name unclear 📘 Rule violation ✓ Correctness
Description
• The newly introduced identifier app_ is ambiguous and does not clearly communicate what it
  represents (an app handle clone).
• The compliance naming requirement expects identifiers to be self-documenting, especially for
  values captured into closures.
Code

examples/api/src-tauri/src/lib.rs[R76-77]

+        let app_ = app.handle().clone();
+        let mut created_window_count = std::sync::atomic::AtomicUsize::new(0);
Evidence
PR Compliance ID 2 requires meaningful, self-documenting naming. app_ is a non-descriptive name; a
clearer name like app_handle would better communicate intent.

Rule 2: Generic: Meaningful Naming and Self-Documenting Code
examples/api/src-tauri/src/lib.rs[76-77]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`app_` is not a self-documenting name for a captured app handle.

## Issue Context
Clear names reduce cognitive overhead when reading closure captures and builder setup.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[76-77]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



ⓘ The new review experience is currently in Beta. Learn more

Qodo Logo

Comment on lines +1316 to 1322
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);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. window_features not rustfmt-formatted 📘 Rule violation ✓ Correctness

• The new window_features implementation contains irregular spacing (multiple spaces after commas
  and missing spaces after commas), which indicates cargo fmt would change the file.
• This violates the requirement that Rust code must already match the project’s rustfmt
  configuration and pass cargo fmt --check without modifications.
Agent prompt
## Issue description
`window_features` contains spacing that likely fails the repository's rustfmt check.

## Issue Context
The code includes extra spaces after a comma and missing spaces after commas; rustfmt would reformat these lines.

## Fix Focus Areas
- crates/tauri/src/webview/webview_window.rs[1315-1322]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +22 to +23
// Remove this re-export in v3
pub use tauri_runtime::Cookie;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. cookie re-export undocumented 📘 Rule violation ✧ Quality

• The PR introduces a new public re-export pub use tauri_runtime::Cookie; without an accompanying
  /// documentation comment.
• This makes the public API harder to understand and violates the requirement that public API
  elements include documentation comments.
Agent prompt
## Issue description
A public re-export (`pub use tauri_runtime::Cookie;`) was added without Rust doc comments.

## Issue Context
Public API items should be self-documented for downstream users and docs generation.

## Fix Focus Areas
- crates/tauri/src/webview/mod.rs[21-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +92 to +101
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 }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. New code uses unwrap() 📘 Rule violation ⛯ Reliability

• The added example code uses unwrap() on fallible operations (parse(), set_title, and
  build()), which can panic at runtime and hides error context.
• The compliance requirement calls for returning/propagating Result for fallible operations rather
  than panicking, especially where failures should be handled gracefully.
Agent prompt
## Issue description
The new code panics via `unwrap()` on operations that can fail.

## Issue Context
Panics reduce robustness and remove useful context. Prefer `Result` propagation and explicit handling.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[89-101]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +84 to +86
.on_new_window(move |url, features| {
println!("new window requested: {url:?} {features:?}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

4. println! logs url/features 📘 Rule violation ⛨ Security

• The new example logs url and features via println!, which is unstructured and may
  inadvertently expose sensitive data contained in URLs (e.g., query parameters or tokens).
• Secure logging practices require logs to avoid sensitive data and be structured for
  auditing/monitoring.
Agent prompt
## Issue description
The new handler logs potentially sensitive URL data using unstructured `println!` output.

## Issue Context
URLs can contain secrets in query params/fragments; logs should be structured and avoid sensitive content.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[84-86]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +76 to +77
let app_ = app.handle().clone();
let mut created_window_count = std::sync::atomic::AtomicUsize::new(0);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

5. app_ variable name unclear 📘 Rule violation ✓ Correctness

• The newly introduced identifier app_ is ambiguous and does not clearly communicate what it
  represents (an app handle clone).
• The compliance naming requirement expects identifiers to be self-documenting, especially for
  values captured into closures.
Agent prompt
## Issue description
`app_` is not a self-documenting name for a captured app handle.

## Issue Context
Clear names reduce cognitive overhead when reading closure captures and builder setup.

## Fix Focus Areas
- examples/api/src-tauri/src/lib.rs[76-77]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 1715 to 1721
Message::Webview(
*self.window_id.lock().unwrap(),
self.webview_id,
WebviewMessage::DeleteCookie(cookie.clone().into_owned()),
WebviewMessage::SetCookie(cookie.into_owned()),
),
)?;
Ok(())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

6. Delete_cookie sets cookie 🐞 Bug ✓ Correctness

WryWebviewDispatcher::delete_cookie dispatches WebviewMessage::SetCookie instead of
  WebviewMessage::DeleteCookie, so callers cannot delete cookies anymore.
• This is a behavior regression: the runtime event loop still has a dedicated DeleteCookie branch
  that calls webview.delete_cookie, but it is never reached from delete_cookie.
• Impact: any code using Webview::delete_cookie will silently behave incorrectly (cookie
  persists/gets overwritten instead of removed).
Agent prompt
### Issue description
`WryWebviewDispatcher::delete_cookie` currently dispatches `WebviewMessage::SetCookie`, making `delete_cookie` behave like `set_cookie` and preventing cookie deletion.

### Issue Context
`WebviewMessage` includes a `DeleteCookie` variant and the message loop handles it by calling `webview.delete_cookie(&cookie)`, but the dispatcher never sends that variant.

### Fix Focus Areas
- crates/tauri-runtime-wry/src/lib.rs[1712-1721]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

3 participants