Skip to content

Commit 22d0660

Browse files
committed
remove Uuid utils from Vpn.Proto
1 parent 4add8bc commit 22d0660

File tree

10 files changed

+10
-49
lines changed

10 files changed

+10
-49
lines changed

App/ViewModels/TrayWindowViewModel.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
169169
List<AgentViewModel> agents = [];
170170
foreach (var agent in rpcModel.Agents)
171171
{
172+
if (!Uuid.TryFrom(agent.Id.Span, out var uuid))
173+
continue;
174+
172175
// Find the FQDN with the least amount of dots and split it into
173176
// prefix and suffix.
174177
var fqdn = agent.Fqdn
@@ -195,7 +198,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
195198

196199
agents.Add(_agentViewModelFactory.Create(
197200
this,
198-
agent.ParseId(),
201+
uuid,
199202
fqdnPrefix,
200203
fqdnSuffix,
201204
connectionStatus,
@@ -207,18 +210,23 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
207210
// dummy agent row.
208211
foreach (var workspace in rpcModel.Workspaces.Where(w =>
209212
w.Status == Workspace.Types.Status.Stopped && !workspacesWithAgents.Contains(w.Id)))
213+
{
214+
if (!Uuid.TryFrom(workspace.Id.Span, out var uuid))
215+
continue;
216+
210217
agents.Add(_agentViewModelFactory.Create(
211218
this,
212219
// Workspace ID is fine as a stand-in here, it shouldn't
213220
// conflict with any agent IDs.
214-
workspace.ParseId(),
221+
uuid,
215222
// We assume that it's a single-agent workspace.
216223
workspace.Name,
217224
// TODO: this needs to get the suffix from the server
218225
".coder",
219226
AgentConnectionStatus.Gray,
220227
credentialModel.CoderUrl,
221228
workspace.Name));
229+
}
222230

223231
// Sort by status green, red, gray, then by hostname.
224232
ModelUpdate.ApplyLists(Agents, agents, (a, b) =>

App/packages.lock.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@
550550
"Coder.Desktop.Vpn.Proto": {
551551
"type": "Project",
552552
"dependencies": {
553-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
554553
"Google.Protobuf": "[3.29.3, )"
555554
}
556555
}

Tests.Vpn.Proto/packages.lock.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,9 @@
7373
"resolved": "1.6.0",
7474
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
7575
},
76-
"Coder.Desktop.CoderSdk": {
77-
"type": "Project"
78-
},
7976
"Coder.Desktop.Vpn.Proto": {
8077
"type": "Project",
8178
"dependencies": {
82-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
8379
"Google.Protobuf": "[3.29.3, )"
8480
}
8581
}

Tests.Vpn.Service/packages.lock.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@
501501
"Coder.Desktop.Vpn.Proto": {
502502
"type": "Project",
503503
"dependencies": {
504-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
505504
"Google.Protobuf": "[3.29.3, )"
506505
}
507506
},

Tests.Vpn/packages.lock.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@
108108
"resolved": "1.6.0",
109109
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
110110
},
111-
"Coder.Desktop.CoderSdk": {
112-
"type": "Project"
113-
},
114111
"Coder.Desktop.Vpn": {
115112
"type": "Project",
116113
"dependencies": {
@@ -123,7 +120,6 @@
123120
"Coder.Desktop.Vpn.Proto": {
124121
"type": "Project",
125122
"dependencies": {
126-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
127123
"Google.Protobuf": "[3.29.3, )"
128124
}
129125
}

Vpn.DebugClient/packages.lock.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
"resolved": "9.0.1",
4343
"contentHash": "uXf5o8eV/gtzDQY4lGROLFMWQvcViKcF8o4Q6KpIOjloAQXrnscQSu6gTxYJMHuNJnh7szIF9AzkaEq+zDLoEg=="
4444
},
45-
"Coder.Desktop.CoderSdk": {
46-
"type": "Project"
47-
},
4845
"Coder.Desktop.Vpn": {
4946
"type": "Project",
5047
"dependencies": {
@@ -57,7 +54,6 @@
5754
"Coder.Desktop.Vpn.Proto": {
5855
"type": "Project",
5956
"dependencies": {
60-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
6157
"Google.Protobuf": "[3.29.3, )"
6258
}
6359
}

Vpn.Proto/Uuid.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

Vpn.Proto/Vpn.Proto.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,4 @@
2121
</PackageReference>
2222
</ItemGroup>
2323

24-
<ItemGroup>
25-
<ProjectReference Include="..\CoderSdk\CoderSdk.csproj" />
26-
</ItemGroup>
27-
2824
</Project>

Vpn.Service/packages.lock.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@
444444
"Coder.Desktop.Vpn.Proto": {
445445
"type": "Project",
446446
"dependencies": {
447-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
448447
"Google.Protobuf": "[3.29.3, )"
449448
}
450449
}

Vpn/packages.lock.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@
4545
"resolved": "9.0.1",
4646
"contentHash": "bHtTesA4lrSGD1ZUaMIx6frU3wyy0vYtTa/hM6gGQu5QNrydObv8T5COiGUWsisflAfmsaFOe9Xvw5NSO99z0g=="
4747
},
48-
"Coder.Desktop.CoderSdk": {
49-
"type": "Project"
50-
},
5148
"Coder.Desktop.Vpn.Proto": {
5249
"type": "Project",
5350
"dependencies": {
54-
"Coder.Desktop.CoderSdk": "[1.0.0, )",
5551
"Google.Protobuf": "[3.29.3, )"
5652
}
5753
}

0 commit comments

Comments
 (0)