Skip to content

Commit

Permalink
if json parsing fails, we still track the change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Jump committed Dec 9, 2019
1 parent 2349275 commit 9baacf6
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions uSync8.Core/Tracking/SyncBaseTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,23 @@ protected uSyncChange Compare(string path, string name, string current, string t
{
if (current.DetectIsJson())
{
return JsonChange(current, target, path, name);
return JsonChange(path, name, current, target, maskValue);
}
else
{
if (current.Equals(target)) return null;

return uSyncChange.Update(path, name,
maskValue ? "*******" : current,
maskValue ? "*******" : target);
return StringChange(path, name, current, target, maskValue);
}
}

private uSyncChange StringChange(string path, string name, string current, string target, bool maskValue)
{
if (current.Equals(target)) return null;
return uSyncChange.Update(path, name,
maskValue ? "*******" : current,
maskValue ? "*******" : target);
}

private uSyncChange JsonChange(string current, string target, string path, string name)
private uSyncChange JsonChange(string path, string name, string current, string target, bool maskValue)
{
try
{
Expand All @@ -422,8 +425,7 @@ private uSyncChange JsonChange(string current, string target, string path, strin
}
catch
{
// malformed json etc, shouldn't make a details check fail.
return null;
return StringChange(path, name, current, target, maskValue);
}
}

Expand Down

0 comments on commit 9baacf6

Please sign in to comment.