Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9257b92

Browse files
committedApr 30, 2025·
PR comments
1 parent 3d83551 commit 9257b92

File tree

4 files changed

+23
-39
lines changed

4 files changed

+23
-39
lines changed
 

‎App/Services/MutagenController.cs

+18-37
Original file line numberDiff line numberDiff line change
@@ -538,44 +538,25 @@ private void StartDaemonProcess()
538538
Directory.CreateDirectory(_mutagenDataDirectory);
539539
var logPath = Path.Combine(_mutagenDataDirectory, "daemon.log");
540540
var logStream = new StreamWriter(logPath, true);
541-
try
542-
{
543-
_daemonProcess = new Process();
544-
_daemonProcess.StartInfo.FileName = _mutagenExecutablePath;
545-
_daemonProcess.StartInfo.Arguments = "daemon run";
546-
_daemonProcess.StartInfo.Environment.Add("MUTAGEN_DATA_DIRECTORY", _mutagenDataDirectory);
547-
// hide the console window
548-
_daemonProcess.StartInfo.CreateNoWindow = true;
549-
// shell needs to be disabled since we set the environment
550-
// https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.environment?view=net-8.0
551-
_daemonProcess.StartInfo.UseShellExecute = false;
552-
_daemonProcess.StartInfo.RedirectStandardError = true;
553-
// TODO: log exited process
554-
// _daemonProcess.Exited += ...
555-
if (!_daemonProcess.Start())
556-
throw new InvalidOperationException("Failed to start mutagen daemon process, Start returned false");
557-
558-
var writer = new LogWriter(_daemonProcess.StandardError, logStream);
559-
Task.Run(() => { _ = writer.Run(); });
560-
_logWriter = writer;
561-
}
562-
catch
563-
{
564-
try
565-
{
566-
_daemonProcess?.Kill();
567-
}
568-
catch
569-
{
570-
// ignored
571-
}
572541

573-
_daemonProcess?.Dispose();
574-
_logWriter?.Dispose();
575-
_daemonProcess = null;
576-
_logWriter = null;
577-
throw;
578-
}
542+
_daemonProcess = new Process();
543+
_daemonProcess.StartInfo.FileName = _mutagenExecutablePath;
544+
_daemonProcess.StartInfo.Arguments = "daemon run";
545+
_daemonProcess.StartInfo.Environment.Add("MUTAGEN_DATA_DIRECTORY", _mutagenDataDirectory);
546+
// hide the console window
547+
_daemonProcess.StartInfo.CreateNoWindow = true;
548+
// shell needs to be disabled since we set the environment
549+
// https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.environment?view=net-8.0
550+
_daemonProcess.StartInfo.UseShellExecute = false;
551+
_daemonProcess.StartInfo.RedirectStandardError = true;
552+
// TODO: log exited process
553+
// _daemonProcess.Exited += ...
554+
if (!_daemonProcess.Start())
555+
throw new InvalidOperationException("Failed to start mutagen daemon process, Start returned false");
556+
557+
var writer = new LogWriter(_daemonProcess.StandardError, logStream);
558+
Task.Run(() => { _ = writer.Run(); });
559+
_logWriter = writer;
579560
}
580561

581562
/// <summary>

‎App/ViewModels/DirectoryPickerViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private void ProcessResponse(ListDirectoryResponse res)
219219
{
220220
new()
221221
{
222-
Name = "(root)",
222+
Name = "🖥️",
223223
AbsolutePathSegments = [],
224224
IsFirst = true,
225225
ViewModel = this,

‎App/ViewModels/FileSyncListViewModel.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ private void SetAvailableHostsFromRpcModel(RpcModel rpcModel)
284284
private void StartCreatingNewSession()
285285
{
286286
ClearNewForm();
287-
// Ensure we have a fresh hosts list before we open the form.
287+
// Ensure we have a fresh hosts list before we open the form. We don't
288+
// bind directly to the list on RPC state updates as updating the list
289+
// while in use seems to break it.
288290
SetAvailableHostsFromRpcModel(_rpcController.GetState());
289291
CreatingNewSession = true;
290292
}

‎Tests.App/Services/CredentialManagerTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Diagnostics;
22
using Coder.Desktop.App.Models;
33
using Coder.Desktop.App.Services;
4+
using Coder.Desktop.CoderSdk.Coder;
45
using Moq;
56

67
namespace Coder.Desktop.Tests.App.Services;

0 commit comments

Comments
 (0)
Please sign in to comment.