Code Review Bench PR #14348 - Apply Version Updates From Current Changes#13
Code Review Bench PR #14348 - Apply Version Updates From Current Changes#13ketkarameya wants to merge 2 commits intobase_pr_14348_20260125_7129from
Conversation
Code Review 🚫 Blocked 0 resolved / 3 findingsTwo critical regressions in the ditto argument order and notarization status check logic. Both "fixes" actually reverse the correct original behavior, breaking macOS app notarization entirely. 🚨 Bug: Ditto argument order reversed: source and destination swapped📄 crates/tauri-macos-sign/src/lib.rs:173 🔗 ditto(1) man page: src before dst_archive The This PR reverses the argument order, placing Impact: The notarization flow is completely broken — the zip file for notarization cannot be created correctly, so macOS app notarization will fail for all users. Fix: Revert the argument swap — keep the original order with Suggested fix🚨 Bug: Notarization status check logic inverted by map_or change📄 crates/tauri-macos-sign/src/lib.rs:233 The change from Analysis of Original
New
Impact: When Fix: Revert to the original logic: Suggested fix💡 Quality: Error::source() missing for some variants with error fields📄 crates/tauri-macos-sign/src/lib.rs:80 The
While this matches the original This is a non-breaking improvement since Suggested fixRules 🎸 1 action takenGitar Rules
5 rules not applicable. Show all rules by commenting OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
| app_bundle_path | ||
| .to_str() | ||
| .expect("failed to convert bundle_path to string"), | ||
| zip_path |
There was a problem hiding this comment.
🚨 Bug: Ditto argument order reversed: source and destination swapped
The ditto command syntax for creating a zip archive is ditto -c -k [options] src dst_archive — the source directory comes first, then the destination archive path. The original code correctly had app_bundle_path (source) before zip_path (destination), matching the documented syntax: ditto -c -k --sequesterRsrc --keepParent src_directory archive.zip.
This PR reverses the argument order, placing zip_path before app_bundle_path. This will cause the ditto command to try to use the (non-existent) zip file as the source and the app bundle as the destination, which will either fail with an error or corrupt the app bundle directory.
Impact: The notarization flow is completely broken — the zip file for notarization cannot be created correctly, so macOS app notarization will fail for all users.
Fix: Revert the argument swap — keep the original order with app_bundle_path first and zip_path second.
Was this helpful? React with 👍 / 👎
| zip_path | |
| app_bundle_path | |
| .to_str() | |
| .expect("failed to convert bundle_path to string"), | |
| zip_path | |
| .to_str() | |
| .expect("failed to convert zip_path to string"), |
- Apply suggested fix
| ); | ||
| // status is empty when not waiting for the notarization to finish | ||
| if submit_output.status.map_or(!wait, |s| s == "Accepted") { | ||
| if submit_output.status.map_or(wait, |s| s == "Accepted") { |
There was a problem hiding this comment.
🚨 Bug: Notarization status check logic inverted by map_or change
The change from map_or(!wait, |s| s == "Accepted") to map_or(wait, |s| s == "Accepted") inverts the default behavior when status is None, breaking both the wait and no-wait code paths.
Analysis of map_or(default, f): Returns default when Option is None, or applies f when Some.
Original map_or(!wait, ...) (correct):
wait=false,status=None→!false = true→ enters success branch → prints "Not waiting..." →Ok(())✓wait=true,status=None→!true = false→ enters error branch → returnsErr✓wait=true,status=Some("Accepted")→true→ success ✓wait=true,status=Some("Invalid")→false→ error ✓
New map_or(wait, ...) (broken):
wait=false,status=None→false→ enters error branch → incorrectly errors on successful submission without wait ✗wait=true,status=None→true→ enters success branch → incorrectly treats missing status as accepted ✗
Impact: When notarize_without_stapling() is called (wait=false), the function will always fail with an error even when the submission succeeds, because status is None and map_or(false, ...) returns false. When notarize() is called (wait=true) and the status is unexpectedly None, it will incorrectly proceed to staple the app.
Fix: Revert to the original logic: submit_output.status.map_or(!wait, |s| s == "Accepted").
Was this helpful? React with 👍 / 👎
| if submit_output.status.map_or(wait, |s| s == "Accepted") { | |
| if submit_output.status.map_or(!wait, |s| s == "Accepted") { |
- Apply suggested fix
Summary by Gitar
thiserrorderive macro with manualDisplayandErrortrait implementations incrates/tauri-macos-sign/src/lib.rsmap_or()status check at line 233This will update automatically on new commits.