1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

[KS-39256] Extra check for invalid group ids in GAB sync.

Added Trace logging to GAB to show all JSON contents.
This commit is contained in:
Patrick Simpson 2018-01-17 14:35:52 +02:00
parent 297271479c
commit 29d9b2d5bf
2 changed files with 21 additions and 6 deletions

View File

@ -48,5 +48,10 @@ namespace Acacia.Features.GAB
return null; return null;
} }
} }
override public string ToString()
{
return string.Format("{0}/{1}", chunk, numberOfChunks);
}
} }
} }

View File

@ -465,6 +465,8 @@ namespace Acacia.Features.GAB
private void ProcessChunkBody(CompletionTracker completion, IZPushItem item, ChunkIndex index) private void ProcessChunkBody(CompletionTracker completion, IZPushItem item, ChunkIndex index)
{ {
Logger.Instance.Trace(this, "Parsing chunck: {0}: {1}", index, item.Body);
// Process the body // Process the body
foreach (var entry in JSONUtils.Deserialise(item.Body)) foreach (var entry in JSONUtils.Deserialise(item.Body))
{ {
@ -732,7 +734,10 @@ namespace Acacia.Features.GAB
if (Get<ArrayList>(value, "memberOf") != null) if (Get<ArrayList>(value, "memberOf") != null)
{ {
ArrayList members = Get<ArrayList>(value, "memberOf"); ArrayList members = Get<ArrayList>(value, "memberOf");
foreach (string memberOf in members) foreach (object memberOfObject in members)
{
string memberOf = memberOfObject as string;
if (memberOf != null)
{ {
using (IItem groupItem = FindItemById(memberOf)) using (IItem groupItem = FindItemById(memberOf))
{ {
@ -744,6 +749,11 @@ namespace Acacia.Features.GAB
} }
} }
} }
else
{
Logger.Instance.Warning(this, "Invalid group: {0}", memberOfObject);
}
}
} }
} }