Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PowerSync/PowerSync.Common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# PowerSync.Common Changelog

## 0.1.4 (Unreleased)
- Fix "No iteration is active" errors when a sync iteration ends

## 0.1.3

- **Breaking:** Made `Table.Name` non-nullable (default ""). This change may affect 0% of users, but it is technically a breaking change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ public static class PowerSyncControlCommand
public const string NOTIFY_TOKEN_REFRESHED = "refreshed_token";
public const string NOTIFY_CRUD_UPLOAD_COMPLETED = "completed_upload";
public const string UPDATE_SUBSCRIPTIONS = "update_subscriptions";

/// <summary>
/// An `established` or `end` event for response streams.
/// </summary>
public const string CONNECTION_STATE = "connection";
}

public static class PowerSyncControlConnectionState
{
public const string ESTABLISHED = "established";
public const string END = "end";
}

public class Checkpoint
Expand Down
16 changes: 10 additions & 6 deletions PowerSync/PowerSync.Common/Client/Sync/Stream/CoreInstructions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace PowerSync.Common.Client.Sync.Stream;
/// </summary>
public abstract class Instruction
{

public static Instruction[] ParseInstructions(string rawResponse)
{
var jsonArray = JArray.Parse(rawResponse);
Expand Down Expand Up @@ -51,7 +50,12 @@ public static Instruction[] ParseInstructions(string rawResponse)
}
}

public class LogLine : Instruction
/// <summary>
/// An <see cref="Instruction"/> that doesn't start or stop a sync iteration.
/// </summary>
public abstract class NonInterruptingInstruction : Instruction { }

public class LogLine : NonInterruptingInstruction
{
[JsonProperty("severity")]
public string Severity { get; set; } = null!; // "DEBUG", "INFO", "WARNING"
Expand All @@ -66,7 +70,7 @@ public class EstablishSyncStream : Instruction
public StreamingSyncRequest Request { get; set; } = null!;
}

public class UpdateSyncStatus : Instruction
public class UpdateSyncStatus : NonInterruptingInstruction
{
[JsonProperty("status")]
public CoreSyncStatus Status { get; set; } = null!;
Expand Down Expand Up @@ -167,7 +171,7 @@ public class BucketProgress
public int TargetCount { get; set; }
}

public class FetchCredentials : Instruction
public class FetchCredentials : NonInterruptingInstruction
{
[JsonProperty("did_expire")]
public bool DidExpire { get; set; }
Expand All @@ -179,8 +183,8 @@ public class CloseSyncStream : Instruction
public bool HideDisconnect { get; set; }
}

public class FlushFileSystem : Instruction { }
public class DidCompleteSync : Instruction { }
public class FlushFileSystem : NonInterruptingInstruction { }
public class DidCompleteSync : NonInterruptingInstruction { }

public class CoreInstructionHelpers
{
Expand Down
Loading