Skip to content

Commit aff7d22

Browse files
committed
Removed SyncClientImplementation.
1 parent 71bf95a commit aff7d22

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

PowerSync/PowerSync.Common/Client/Sync/Stream/StreamingSyncImplementation.cs

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,6 @@ namespace PowerSync.Common.Client.Sync.Stream;
1212
using PowerSync.Common.DB.Crud;
1313
using PowerSync.Common.Utils;
1414

15-
16-
17-
public enum SyncClientImplementation
18-
{
19-
20-
/// <summary>
21-
/// This implementation offloads the sync line decoding and handling into the PowerSync core extension.
22-
///
23-
/// ## Compatibility warning
24-
///
25-
/// The Rust sync client stores sync data in a format that is slightly different than the one used
26-
/// by the old C# implementation. When adopting the RUST client on existing
27-
/// databases, the PowerSync SDK will migrate the format automatically.
28-
RUST
29-
}
30-
3115
public class AdditionalConnectionOptions(int? retryDelayMs = null, int? crudUploadThrottleMs = null)
3216
{
3317
/// <summary>
@@ -66,24 +50,17 @@ public class StreamingSyncImplementationOptions : AdditionalConnectionOptions
6650
public ILogger? Logger { get; init; }
6751
}
6852

69-
public class BaseConnectionOptions(Dictionary<string, object>? parameters = null, SyncClientImplementation? clientImplementation = null)
53+
public class BaseConnectionOptions(Dictionary<string, object>? parameters = null)
7054
{
7155
/// <summary>
7256
/// These parameters are passed to the sync rules and will be available under the `user_parameters` object.
7357
/// </summary>
7458
public Dictionary<string, object>? Params { get; set; } = parameters;
75-
76-
/// <summary>
77-
/// Whether to use the RUST or C# sync client implementation.
78-
/// </summary>
79-
public SyncClientImplementation? ClientImplementation { get; set; } = clientImplementation;
8059
}
8160

8261
public class RequiredPowerSyncConnectionOptions : BaseConnectionOptions
8362
{
8463
public new Dictionary<string, object> Params { get; set; } = new();
85-
86-
public new SyncClientImplementation ClientImplementation { get; set; } = new();
8764
}
8865

8966
public class StreamingSyncImplementationEvent
@@ -121,7 +98,6 @@ public class StreamingSyncImplementation : EventStream<StreamingSyncImplementati
12198
public static RequiredPowerSyncConnectionOptions DEFAULT_STREAM_CONNECTION_OPTIONS = new()
12299
{
123100
Params = [],
124-
ClientImplementation = SyncClientImplementation.RUST
125101
};
126102

127103
public static readonly int DEFAULT_CRUD_UPLOAD_THROTTLE_MS = 1000;
@@ -406,17 +382,10 @@ protected async Task<StreamingSyncIterationResult> StreamingSyncIteration(Cancel
406382
var resolvedOptions = new RequiredPowerSyncConnectionOptions
407383
{
408384
Params = options?.Params ?? DEFAULT_STREAM_CONNECTION_OPTIONS.Params,
409-
ClientImplementation = options?.ClientImplementation ?? DEFAULT_STREAM_CONNECTION_OPTIONS.ClientImplementation
410385
};
411386

412-
if (resolvedOptions.ClientImplementation == SyncClientImplementation.RUST)
413-
{
414-
return await RustStreamingSyncIteration(signal, resolvedOptions);
415-
}
416-
else
417-
{
418-
throw new NotImplementedException("C_SHARP sync client implementation is no longer supported.");
419-
}
387+
388+
return await RustStreamingSyncIteration(signal, resolvedOptions);
420389
}
421390
});
422391
}

Tests/PowerSync/PowerSync.Common.IntegrationTests/SyncIntegrationTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ public async Task InitializeAsync()
4343
Console.WriteLine($"Using User ID: {userId}");
4444
try
4545
{
46-
await db.Connect(connector, new PowerSyncConnectionOptions
47-
{
48-
ClientImplementation = SyncClientImplementation.RUST,
49-
});
46+
await db.Connect(connector);
5047
await db.WaitForFirstSync();
5148
}
5249
catch (Exception ex)

0 commit comments

Comments
 (0)