Skip to content

Conversation

@matiasdaloia
Copy link
Collaborator

@matiasdaloia matiasdaloia commented Nov 7, 2025

Summary by CodeRabbit

  • Changed

    • Update-related functionality consolidated and largely removed from the app; automatic update checks and in-app update flows are no longer active.
  • Removed

    • In-app update notifications, download/install UI, and update service APIs have been removed.
  • Documentation

    • Auto-updates section removed from the README and changelog entry simplified to a minimal note about a macOS postinstall fix.

@matiasdaloia matiasdaloia self-assigned this Nov 7, 2025
@matiasdaloia matiasdaloia added the bug Something isn't working label Nov 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Removes the entire UpdateService subsystem and related frontend bindings/UI: backend update interface and implementation, mocks, frontend UpdateNotification and UpdateInfo model, Wails JS/TS bindings, README changelog section, and associated dependencies and startup hooks are deleted.

Changes

Cohort / File(s) Summary
Backend — Update service removed
backend/service/update_service.go, backend/service/update_service_impl.go
Delete the UpdateService interface and its implementation, removing all methods (CheckForUpdate, DownloadUpdate, ApplyUpdate, GetCurrentVersion, SetContext, VerifyUpdateSuccess, CheckForFailedUpdate) and related update logic.
Backend — Mocks removed
backend/service/mocks/mock_UpdateService.go
Remove autogenerated mock for UpdateService and its helper/expectation methods.
Frontend — UI & model removed
frontend/src/components/UpdateNotification.tsx, frontend/src/components/StatusBar.tsx, frontend/wailsjs/go/models.ts
Remove UpdateNotification component and its usage in StatusBar; delete UpdateInfo model and parsing/conversion logic.
Frontend — Wails bindings removed
frontend/wailsjs/go/service/UpdateServiceImpl.js, frontend/wailsjs/go/service/UpdateServiceImpl.d.ts
Remove generated JS/TS bindings that wrapped the backend UpdateService methods.
CLI / startup changes
main.go, cmd/root.go
Remove instantiation/usage of UpdateService and the Linux startup pending-update check; consolidate var declarations in cmd/root.go.
Dependency updates
go.mod
Remove direct and indirect dependencies related to the removed update implementation (github.com/Masterminds/semver/v3, github.com/inconshreveable/go-update).
Docs
README.md, CHANGELOG.md
Remove Auto-Updates documentation and pare down changelog entries related to the update subsystem.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Files warranting extra attention:
    • backend/service/update_service_impl.go and backend/service/update_service.go deletions — ensure no remaining references or compilation errors elsewhere.
    • frontend/wailsjs/... bindings removal — confirm generated bindings and build pipeline adjustments.
    • backend/service/mocks/mock_UpdateService.go — check tests that referenced mocks and update test setup.
    • frontend/src/components/StatusBar.tsx and other UI changes — verify no leftover imports or broken JSX.
    • go.mod — confirm removed dependencies are not required by other code.

Possibly related PRs

Suggested reviewers

  • eeisegn

Poem

🐰
I hopped through code and left a trail,
Quieted the updater's busy tale.
Fewer files, a lighter paw,
I nudge the repo, nibble the claw—🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'fix: auto updater logic' is vague and does not clearly indicate the main change: complete removal of the auto-update feature. Use a more descriptive title like 'Remove auto-update feature' or 'Remove auto updater implementation' to clearly communicate that the entire update system is being removed, not fixed.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/mdaloia/auto-updater

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a406ee and aec2614.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (13)
  • CHANGELOG.md (0 hunks)
  • README.md (0 hunks)
  • backend/service/mocks/mock_UpdateService.go (0 hunks)
  • backend/service/update_service.go (0 hunks)
  • backend/service/update_service_impl.go (0 hunks)
  • cmd/root.go (1 hunks)
  • frontend/src/components/StatusBar.tsx (0 hunks)
  • frontend/src/components/UpdateNotification.tsx (0 hunks)
  • frontend/wailsjs/go/models.ts (0 hunks)
  • frontend/wailsjs/go/service/UpdateServiceImpl.d.ts (0 hunks)
  • frontend/wailsjs/go/service/UpdateServiceImpl.js (0 hunks)
  • go.mod (0 hunks)
  • main.go (0 hunks)
💤 Files with no reviewable changes (12)
  • go.mod
  • README.md
  • CHANGELOG.md
  • frontend/src/components/StatusBar.tsx
  • backend/service/update_service.go
  • main.go
  • backend/service/update_service_impl.go
  • frontend/wailsjs/go/models.ts
  • frontend/src/components/UpdateNotification.tsx
  • frontend/wailsjs/go/service/UpdateServiceImpl.js
  • frontend/wailsjs/go/service/UpdateServiceImpl.d.ts
  • backend/service/mocks/mock_UpdateService.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/root.go
⏰ 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). (1)
  • GitHub Check: build

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 184
  • Detected files undeclared: 0
  • Detected files declared: 184
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/service/update_service_impl.go (1)

304-315: Create the mount point before calling hdiutil attach.

Line 305 currently invokes hdiutil attach … -mountpoint on a directory that never gets created, so the command fails with “No such file or directory,” aborting every macOS update.

Apply this diff to prepare the mount point:

 	// Mount the DMG
 	mountPoint := filepath.Join(os.TempDir(), "scanoss-update-mount")
+	if err := os.MkdirAll(mountPoint, 0o755); err != nil {
+		return fmt.Errorf("failed to prepare mount point: %w", err)
+	}
 	log.Info().Msgf("Mounting DMG to %s...", mountPoint)
 	cmd = exec.Command("hdiutil", "attach", dmgPath, "-nobrowse", "-mountpoint", mountPoint)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17255f5 and 099e749.

📒 Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • backend/service/update_service_impl.go (2 hunks)
  • go.mod (1 hunks)
  • main.go (0 hunks)
💤 Files with no reviewable changes (1)
  • main.go
⏰ 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). (1)
  • GitHub Check: build

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 184
  • Detected files undeclared: 0
  • Detected files declared: 184
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/service/update_service_impl.go (1)

455-460: Guard Windows update failures with a rollback.
Same concern here: if update.Apply fails we need to call update.RollbackError(err) before returning, otherwise the running exe may be left unusable.

-	// Apply the update using go-update
-	log.Info().Msg("Applying update...")
-	err = update.Apply(newBinary, update.Options{
-		TargetPath: currentExe,
-	})
-	if err != nil {
-		return fmt.Errorf("failed to apply update: %w", err)
-	}
+	// Apply the update using go-update
+	log.Info().Msg("Applying update...")
+	if err := update.Apply(newBinary, update.Options{
+		TargetPath: currentExe,
+	}); err != nil {
+		if rollbackErr := update.RollbackError(err); rollbackErr != nil {
+			log.Error().Err(rollbackErr).Msg("failed to rollback after Windows update error")
+		}
+		return fmt.Errorf("failed to apply update: %w", err)
+	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 099e749 and 64787b1.

📒 Files selected for processing (1)
  • backend/service/update_service_impl.go (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/service/update_service_impl.go (3)
internal/config/config.go (1)
  • GetInstance (111-116)
frontend/wailsjs/go/main/App.js (1)
  • GetScanRoot (17-19)
frontend/wailsjs/runtime/runtime.js (1)
  • Quit (184-186)

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 184
  • Detected files undeclared: 0
  • Detected files declared: 184
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
backend/service/update_service_impl.go (1)

454-461: Add rollback when go-update Apply fails on Windows.

The Windows update path does not invoke update.RollbackError when update.Apply fails, while macOS (Lines 370-372) and Linux (Lines 563-565) both include this critical recovery mechanism. Without rollback, a failed update can leave the binary in a corrupted state.

Apply this diff to add rollback handling:

 	// Apply the update using go-update
 	log.Info().Msg("Applying update...")
-	err = update.Apply(newBinary, update.Options{
+	if err := update.Apply(newBinary, update.Options{
 		TargetPath: currentExe,
-	})
-	if err != nil {
+	}); err != nil {
+		if rollbackErr := update.RollbackError(err); rollbackErr != nil {
+			log.Error().Err(rollbackErr).Msg("failed to rollback after Windows update error")
+		}
 		return fmt.Errorf("failed to apply update: %w", err)
 	}
🧹 Nitpick comments (2)
backend/service/update_service_impl.go (2)

466-466: Consider explicit scan-root argument for consistency with macOS.

The Windows restart uses os.Args[1:] while macOS explicitly passes --scan-root (line 388). This creates platform-specific behavior where Windows may not preserve the scan root configuration if the application was started without those arguments.

For consistency, consider mirroring the macOS approach:

+	currentScanRoot := config.GetInstance().GetScanRoot()
+	var args []string
+	if currentScanRoot != "" {
+		args = []string{"--scan-root", currentScanRoot}
+	}
+	cmd = exec.Command(currentExe, args...)
-	cmd = exec.Command(currentExe, os.Args[1:]...)

572-572: Consider explicit scan-root argument for cross-platform consistency.

Similar to the Windows restart logic, Linux uses os.Args[1:] while macOS explicitly passes --scan-root. This creates platform-specific behavior in how the scan root configuration is preserved across updates.

For consistency across all platforms, consider:

+	currentScanRoot := config.GetInstance().GetScanRoot()
+	var args []string
+	if currentScanRoot != "" {
+		args = []string{"--scan-root", currentScanRoot}
+	}
+	cmd = exec.Command(currentExe, args...)
-	cmd = exec.Command(currentExe, os.Args[1:]...)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64787b1 and 51227ff.

📒 Files selected for processing (1)
  • backend/service/update_service_impl.go (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/service/update_service_impl.go (1)
internal/config/config.go (1)
  • GetInstance (111-116)
⏰ 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). (2)
  • GitHub Check: integration-tests
  • GitHub Check: unit_tests
🔇 Additional comments (3)
backend/service/update_service_impl.go (3)

45-45: LGTM!

The config import is properly used at line 387 to retrieve the current scan root for preserving application state across restarts.


306-308: LGTM!

The mount point preparation logic is correct with appropriate error handling.


557-567: LGTM on rollback implementation!

The Linux update path now correctly includes rollback error handling, consistent with the macOS implementation. This addresses the critical issue from previous reviews.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 183
  • Detected files undeclared: 0
  • Detected files declared: 183
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 182
  • Detected files undeclared: 0
  • Detected files declared: 182
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 182
  • Detected files undeclared: 0
  • Detected files declared: 182
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (2)
backend/service/update_service_impl.go (2)

576-581: Add rollback when go-update Apply fails on Windows.

The past review flagged that update.Apply does not restore the original binary on failure. The suggested fix to wrap with update.RollbackError(err) was not applied in this PR.

Apply this diff:

 	// Apply the update using go-update
 	log.Info().Msg("Applying update...")
-	err = update.Apply(newBinary, update.Options{
+	if err := update.Apply(newBinary, update.Options{
 		TargetPath: currentExe,
-	})
-	if err != nil {
+	}); err != nil {
+		if rollbackErr := update.RollbackError(err); rollbackErr != nil {
+			log.Error().Err(rollbackErr).Msg("failed to rollback after Windows update error")
+		}
 		return fmt.Errorf("failed to apply update: %w", err)
 	}

494-495: Validate scan root before passing to helper script.

GetScanRoot() may return an empty string or invalid path. The helper script does check for empty string (line 131), but invalid paths are not validated. This could cause the restarted app to fail or lose user configuration, as flagged in past reviews.

Apply this diff:

 	// Get current scan root
 	currentScanRoot := config.GetInstance().GetScanRoot()
+	
+	// Validate scan root if provided
+	if currentScanRoot != "" {
+		if info, err := os.Stat(currentScanRoot); err != nil || !info.IsDir() {
+			log.Warn().Str("scan_root", currentScanRoot).Msg("Scan root is invalid, will not pass to restarted app")
+			currentScanRoot = ""
+		}
+	}
🧹 Nitpick comments (3)
backend/service/update_service_impl.go (3)

86-90: Reduce timeout from 30 to 10 seconds.

A 30-second wait is excessive for a graceful app quit triggered by wailsruntime.Quit(). The helper launches after the quit is initiated, so the process should exit within a few seconds. A 10-second timeout provides adequate buffer while improving user experience.


498-502: Check for existing helper script and handle write errors.

If /tmp/scanoss-update-helper.sh already exists from a previous failed update, it could have incorrect permissions or content. Also, /tmp may be mounted with noexec on some systems.

Consider these improvements:

 	// Write the helper script to a temporary file
-	helperScriptPath := filepath.Join(os.TempDir(), "scanoss-update-helper.sh")
+	helperScriptPath := filepath.Join(os.TempDir(), fmt.Sprintf("scanoss-update-helper-%d.sh", os.Getpid()))
+	
+	// Remove any existing script
+	os.Remove(helperScriptPath)
+	
 	if err := os.WriteFile(helperScriptPath, []byte(updateHelperScript), 0o755); err != nil {
 		return fmt.Errorf("failed to write helper script: %w", err)
 	}

507-510: Add error context and verify script is executable.

If the helper script fails to launch, the error message doesn't indicate why. Common causes include noexec mount flags or permission issues.

+	// Verify script is executable
+	if info, err := os.Stat(helperScriptPath); err != nil {
+		return fmt.Errorf("helper script not accessible: %w", err)
+	} else if info.Mode()&0o111 == 0 {
+		return fmt.Errorf("helper script is not executable (permissions: %v)", info.Mode())
+	}
+	
 	// Launch the helper script in the background
 	cmd = exec.Command(helperScriptPath, currentAppPath, newAppPath, backupPath, currentScanRoot, fmt.Sprintf("%d", pid))
+	cmd.Stdout = os.Stdout
+	cmd.Stderr = os.Stderr
 	if err := cmd.Start(); err != nil {
-		return fmt.Errorf("failed to launch helper script: %w", err)
+		return fmt.Errorf("failed to launch helper script (check /tmp mount flags): %w", err)
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cac6ad and 9a406ee.

📒 Files selected for processing (1)
  • backend/service/update_service_impl.go (8 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/service/update_service_impl.go (3)
internal/config/config.go (1)
  • GetInstance (111-116)
frontend/wailsjs/go/service/UpdateServiceImpl.js (3)
  • GetCurrentVersion (21-23)
  • VerifyUpdateSuccess (29-31)
  • CheckForFailedUpdate (9-11)
backend/entities/version.go (1)
  • AppVersion (29-29)
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (4)
backend/service/update_service_impl.go (4)

45-45: LGTM!

The config import is appropriately used to retrieve the scan root for passing to restarted applications.


586-591: LGTM on scan root handling.

The scan root is properly retrieved and conditionally passed as args only when non-empty. This correctly handles the case where scan root is not configured.


675-702: LGTM! Rollback and scan root handling are correct.

The Linux update path correctly implements:

  1. Rollback handling via update.RollbackError(err) (lines 688-690) - this addresses the critical issue from past reviews
  2. Proper scan root retrieval and conditional passing to restarted app (lines 697-701)

745-748: LGTM!

Simple getter method correctly returns the application version.

log "Old process exited"
# Additional grace period for file locks to release
sleep 2
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Make grace period configurable or increase duration.

The hardcoded 2-second delay may be insufficient on slower systems or under heavy I/O load. Consider increasing to 5 seconds or making it configurable.

🤖 Prompt for AI Agents
In backend/service/update_service_impl.go at line 94, the hardcoded "sleep 2"
delay is too short and should be made configurable or increased; replace the
literal sleep with a time-based sleep using a configurable duration (e.g., a new
config field or environment variable) that defaults to 5 seconds, parse and
validate the configured value (fallback to 5s on parse error), and use
time.Duration(value)*time.Second for the sleep; update any initialization to
expose the new config option and adjust/ add tests or documentation to reflect
the configurable grace period.

Comment on lines 479 to 486
// Current app bundle path (assuming /Applications installation)
currentAppPath := "/Applications/scanoss-cc.app"
log.Info().Msgf("Current app bundle: %s", currentAppPath)

// Verify the current app exists
if _, err := os.Stat(currentAppPath); err != nil {
return fmt.Errorf("current app not found at %s: %w", currentAppPath, err)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Derive app bundle path from running executable instead of hardcoding.

Line 480 hardcodes /Applications/scanoss-cc.app, which will fail for users who installed the app in a different location (e.g., ~/Applications, custom directories, or running from DMG). This is a repeat of the issue flagged in past reviews.

Apply this diff to derive the actual bundle path:

-	// Current app bundle path (assuming /Applications installation)
-	currentAppPath := "/Applications/scanoss-cc.app"
-	log.Info().Msgf("Current app bundle: %s", currentAppPath)
-
-	// Verify the current app exists
-	if _, err := os.Stat(currentAppPath); err != nil {
-		return fmt.Errorf("current app not found at %s: %w", currentAppPath, err)
-	}
+	// Derive current app bundle path from running executable
+	currentExe, err := os.Executable()
+	if err != nil {
+		return fmt.Errorf("failed to get current executable: %w", err)
+	}
+	
+	// Resolve symlinks
+	currentExe, err = filepath.EvalSymlinks(currentExe)
+	if err != nil {
+		return fmt.Errorf("failed to resolve executable path: %w", err)
+	}
+	
+	// Navigate up to .app bundle (exe is in App.app/Contents/MacOS/)
+	currentAppPath := filepath.Dir(filepath.Dir(filepath.Dir(currentExe)))
+	if !strings.HasSuffix(currentAppPath, ".app") {
+		return fmt.Errorf("could not determine .app bundle path from executable: %s", currentExe)
+	}
+	
+	log.Info().Msgf("Current app bundle: %s", currentAppPath)
+	
+	// Verify the current app exists
+	if _, err := os.Stat(currentAppPath); err != nil {
+		return fmt.Errorf("current app bundle not accessible: %w", err)
+	}
🤖 Prompt for AI Agents
In backend/service/update_service_impl.go around lines 479 to 486, the code
currently hardcodes "/Applications/scanoss-cc.app" which breaks for installs in
other locations; replace this with logic that derives the app bundle path from
the running executable: call os.Executable(), resolve symlinks with
filepath.EvalSymlinks, then walk up parent directories until you find a path
that ends with ".app" (or otherwise determine the bundle root) and use that as
currentAppPath; retain the existing os.Stat check and logging but log the
derived path and return an error if no .app bundle root can be found.

Comment on lines 488 to 489
// Backup path
backupPath := "/Applications/.scanoss-cc.app.backup"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Derive backup path from current app location.

The hardcoded backup path /Applications/.scanoss-cc.app.backup assumes the app is in /Applications. This will fail or create orphaned backups when the app is installed elsewhere.

Apply this diff:

-	// Backup path
-	backupPath := "/Applications/.scanoss-cc.app.backup"
+	// Backup path (same directory as current app)
+	backupPath := filepath.Join(filepath.Dir(currentAppPath), "."+filepath.Base(currentAppPath)+".backup")

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In backend/service/update_service_impl.go around lines 488-489, the backup path
is hardcoded to /Applications/.scanoss-cc.app.backup; change it to derive the
backup path from the running application's location: call os.Executable() to get
the executable path, use filepath.Dir to find the app directory, then build the
backup path by joining that directory with ".scanoss-cc.app.backup" (or place
the backup sibling to the executable as appropriate), and handle errors from
os.Executable() (logging/returning) so we don't proceed with an invalid path.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 183
  • Detected files undeclared: 0
  • Detected files declared: 183
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@matiasdaloia matiasdaloia merged commit 8646c74 into main Nov 7, 2025
6 checks passed
@matiasdaloia matiasdaloia deleted the fix/mdaloia/auto-updater branch November 7, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants