New client node data pull from server
- Dominant language
- C#
- Stars
- 37
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Dear @egarim
I appreciate your hard work. I found it an excellent sync library. I have seen all of your videos regarding the sync framework.
The Unit test is not depicting all the scenarios. Please consider the following procedure.
Let's say I have a client node connected to the server with Identity = store 1. The client syncs all its data to the server. Somehow client one crashed/lost their data, or I want the same data to be synced on 2nd device, or a fresh client with the same Identity want to restore data. It is working fine, but It does not sync its data; it syncs all other data. I have seen the code in `ISyncServerNode,` which fetches deltas for other Nodes.
```
public class SyncServerNode : ISyncServerNode
{
...
public virtual Task> GetDeltasAsync(Guid startindex, string identity, CancellationToken cancellationToken)
{
return this.deltaStore?.GetDeltasFromOtherNodes(startindex, identity, cancellationToken);
}
...
```
Look at this code `return this.deltaStore?.GetDeltasFromOtherNodes(startindex, identity, cancellationToken);` It fetches data of other nodes. There should be another function in the `ISyncServerNode.`
```
public interface ISyncServerNode
{
string NodeId { get; set; }
Task SaveDeltasAsync(IEnumerable deltas, CancellationToken cancellationToken);
Task> GetDeltasFromOtherNodesAsync(Guid startindex, string identity, CancellationToken cancellationToken);
Task> GetDeltasAsync(Guid startindex, CancellationToken cancellationToken);
Task ProcessDeltasAsync(IEnumerable deltas, CancellationToken cancellationToken);
}
```
There should be two functions like
```
Task> GetDeltasFromOtherNodesAsync(Guid startindex, string identity, CancellationToken cancellationToken);
Task> GetDeltasAsync(Guid startindex, CancellationToken cancellationToken);
```
One should be used for the normal operation scenario, and the 2nd should be used in case of a fresh/new/crashed node. Similarly, the `SynController` Fetch function should also be updated with NodeId and without NodeId or another filter header.
Thank you,
Qamar Abbas
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.