Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into becca/separate-test…
Browse files Browse the repository at this point in the history
…-job
  • Loading branch information
RebeccaMahany committed Dec 16, 2024
2 parents f4a4c67 + 0c60d4c commit 2d26421
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions ee/desktop/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,28 @@ func (r *DesktopUsersProcessesRunner) SendNotification(n notify.Notification) er
return errors.New("cannot send notification, no child desktop processes")
}

atLeastOneSuccess := false
errs := make([]error, 0)
for _, proc := range r.uidProcs {
for uid, proc := range r.uidProcs {
client := client.New(r.userServerAuthToken, proc.socketPath)
if err := client.Notify(n); err != nil {
errs = append(errs, err)
continue
}

r.slogger.Log(context.TODO(), slog.LevelDebug,
"sent notification",
"uid", uid,
)
atLeastOneSuccess = true
}

if len(errs) > 0 {
return fmt.Errorf("errors sending notifications: %+v", errs)
// We just need to be able to notify one user successfully.
if atLeastOneSuccess {
return nil
}

return nil
return fmt.Errorf("errors sending notifications: %+v", errs)
}

// Update handles control server updates for the desktop-menu subsystem
Expand Down Expand Up @@ -501,7 +510,7 @@ func (r *DesktopUsersProcessesRunner) FlagsChanged(flagKeys ...keys.FlagKey) {
"sending refresh command to user desktop process",
"uid", uid,
"pid", proc.Process.Pid,
"path", proc.path,
"path", proc.socketPath,
"err", err,
)
}
Expand Down
2 changes: 1 addition & 1 deletion ee/desktop/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func symlinkPreexistingBinary(ctx context.Context, executablePath string) error
}

// Get our current version
gitCmd := exec.CommandContext(ctx, "git", "describe", "--tags", "--always", "--dirty")
gitCmd := exec.CommandContext(ctx, "git", "describe", "--tags", "--always", "--dirty") //nolint:forbidigo // Fine to use exec.CommandContext in test
versionOut, err := gitCmd.CombinedOutput()
if err != nil {
return fmt.Errorf("getting current version: %w", err)
Expand Down

0 comments on commit 2d26421

Please sign in to comment.