diff --git a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs index b6c8a41ae72..777300a2b7d 100644 --- a/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs +++ b/products/ASC.Files/Core/Configuration/ProductEntryPoint.cs @@ -140,7 +140,7 @@ public string GetModuleResource(string ResourceClassTypeName, string ResourseKey } } - public override async Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant, WhatsNewType whatsNewType) + public override async Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant, WhatsNewType whatsNewType, ILogger logger) { IEnumerable events; _tenantManager.SetCurrentTenant(tenant); @@ -203,8 +203,17 @@ public override async Task> GetAuditEventsAsync(DateTi activityInfo.FileUrl = _commonLinkUtility.GetFullAbsolutePath(_filesLinkUtility.GetFileWebEditorUrl(e.Target.GetItems().FirstOrDefault())); } - var obj = e.Description.LastOrDefault(); - var additionalInfo = JsonSerializer.Deserialize(obj); + AdditionalNotificationInfo additionalInfo; + + try + { + additionalInfo = JsonSerializer.Deserialize(e.Description.LastOrDefault()); + } + catch (Exception ex) + { + logger.ErrorWithException("Error deserializing audit event: " + e.Id, ex); + continue; + } activityInfo.TargetUsers = additionalInfo.UserIds; diff --git a/products/ASC.Files/Core/Core/FileStorageService.cs b/products/ASC.Files/Core/Core/FileStorageService.cs index 1331fbdaf2e..00435a48fb7 100644 --- a/products/ASC.Files/Core/Core/FileStorageService.cs +++ b/products/ASC.Files/Core/Core/FileStorageService.cs @@ -1221,7 +1221,7 @@ public async Task UpdateCommentAsync(T fileId, int version, string co comment = await fileDao.UpdateCommentAsync(fileId, version, comment); - await _filesMessageService.SendAsync(MessageAction.FileUpdatedRevisionComment, file, file.Title, version.ToString(CultureInfo.InvariantCulture)); + await _filesMessageService.SendAsync(MessageAction.FileUpdatedRevisionComment, file, new[] { file.Title, version.ToString(CultureInfo.InvariantCulture) }); return comment; } diff --git a/web/ASC.Web.Core/IProduct.cs b/web/ASC.Web.Core/IProduct.cs index a8e06ca8f2b..bc344905180 100644 --- a/web/ASC.Web.Core/IProduct.cs +++ b/web/ASC.Web.Core/IProduct.cs @@ -38,5 +38,5 @@ public interface IProduct : IWebItem void Shutdown(); - Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant,WhatsNewType whatsNewType); + Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant,WhatsNewType whatsNewType, ILogger logger); } diff --git a/web/ASC.Web.Core/Notify/StudioWhatsNewNotify.cs b/web/ASC.Web.Core/Notify/StudioWhatsNewNotify.cs index 4bbcf350069..1e35db68343 100644 --- a/web/ASC.Web.Core/Notify/StudioWhatsNewNotify.cs +++ b/web/ASC.Web.Core/Notify/StudioWhatsNewNotify.cs @@ -176,7 +176,7 @@ private async Task SendMsgWhatsNewAsync(int tenantid, DateTime scheduleDate, Wha foreach (var p in products) { - auditEvents.AddRange(await p.GetAuditEventsAsync(scheduleDate, user.Id, tenant, whatsNewType)); + auditEvents.AddRange(await p.GetAuditEventsAsync(scheduleDate, user.Id, tenant, whatsNewType, _log)); } _log.Debug($"SendMsgWhatsNew auditEvents count : {auditEvents.Count}");//temp diff --git a/web/ASC.Web.Core/Product.cs b/web/ASC.Web.Core/Product.cs index 35729477fb6..f1f14d147f5 100644 --- a/web/ASC.Web.Core/Product.cs +++ b/web/ASC.Web.Core/Product.cs @@ -49,7 +49,7 @@ public abstract class Product : IProduct public virtual void Shutdown() { } - public virtual Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant, WhatsNewType whatsNewType) + public virtual Task> GetAuditEventsAsync(DateTime scheduleDate, Guid userId, Tenant tenant, WhatsNewType whatsNewType, ILogger logger) { return Task.FromResult(Enumerable.Empty()); }