Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit39c41f4

Browse files
committed
feat: add telemetry enrichment to StartRequest
1 parente0a11dd commit39c41f4

File tree

6 files changed

+251
-157
lines changed

6 files changed

+251
-157
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
usingCoder.Desktop.Vpn.Proto;
2+
usingCoder.Desktop.Vpn.Service;
3+
4+
namespaceCoder.Desktop.Tests.Vpn.Service;
5+
6+
[TestFixture]
7+
publicclassTelemetryEnricherTest
8+
{
9+
[Test]
10+
publicvoidEnrichStartRequest()
11+
{
12+
varreq=newStartRequest
13+
{
14+
CoderUrl="https://coder.example.com",
15+
};
16+
varenricher=newTelemetryEnricher();
17+
req=enricher.EnrichStartRequest(req);
18+
19+
// quick sanity check that non-telemetry fields aren't lost or overwritten
20+
Assert.That(req.CoderUrl,Is.EqualTo("https://coder.example.com"));
21+
22+
Assert.That(req.DeviceOs,Is.EqualTo("Windows"));
23+
// seems that test assemblies always set 1.0.0.0
24+
Assert.That(req.CoderDesktopVersion,Is.EqualTo("1.0.0.0"));
25+
Assert.That(req.DeviceId,Is.Not.Empty);
26+
vardeviceId=req.DeviceId;
27+
28+
// deviceId is different on different machines, but we can test that
29+
// each instance of the TelemetryEnricher produces the same value.
30+
enricher=newTelemetryEnricher();
31+
req=enricher.EnrichStartRequest(newStartRequest());
32+
Assert.That(req.DeviceId,Is.EqualTo(deviceId));
33+
}
34+
}

‎Vpn.Proto/RpcVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Coder.Desktop.Vpn.Proto;
55
/// </summary>
66
publicclassRpcVersion
77
{
8-
publicstaticreadonlyRpcVersionCurrent=new(1,0);
8+
publicstaticreadonlyRpcVersionCurrent=new(1,1);
99

1010
publiculongMajor{get;}
1111
publiculongMinor{get;}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp