Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3186

Regression upgrading driver from 2.7 to 2.11

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.0
    • Component/s: Serialization
    • None

      I have a project that runs perfectly fine with 2.7 drivers. After upgrading to 2.11 we start getting lots of error with the serializer. As an example these are two classes that we use in the project and that worked perfectly with 2.7 driver but fails to be deserialized with 2.11 driver.

       

      public class ReportConfigurationLayoutSet : DomainEvent
       {
       [JsonConstructor]
       private ReportConfigurationLayoutSet()
       {
       }
      public ReportConfigurationLayoutSet(
       ReportDocumentConfigurationValueObject newLayout,
       ReportDocumentConfigurationValueObject oldLayout
       )
       {
       NewLayout = newLayout ?? throw new ArgumentNullException(nameof(newLayout));
       OldLayout = oldLayout;
       }
      public ReportDocumentConfigurationValueObject NewLayout { get; private set; }
      public ReportDocumentConfigurationValueObject OldLayout { get; private set; }
       }
       
      public class ReportDocumentConfigurationValueObject
       {
       /// <summary>
       /// we assume that we have a list of types of nodes, where a node can be a template to be aggregated to
       /// the docx or a repeated section of template.
       /// for the offer document the repeated sections can be machines, modules inside machines, etc...
       /// </summary>
       public List<ReportConfigurationNodeValueObject> Nodes { get; private set; }
      public ReportConfigurationTypeId ReportTypeId { get; private set; }
      [JsonConstructor]
       private ReportDocumentConfigurationValueObject()
       {
       }
      public ReportDocumentConfigurationValueObject(
       List<ReportConfigurationNodeValueObject> nodes,
       ReportConfigurationTypeId reportTypeId)
       {
       Nodes = nodes ?? throw new ArgumentNullException(nameof(nodes));
       ReportTypeId = reportTypeId ?? throw new ArgumentNullException(nameof(reportTypeId));
       }
      

       

      Upgrading to 2.11 driver I started got this error.

       

       

      An error occurred while deserializing the Events property of class NStore.Domain.Changeset: 
      An error occurred while deserializing the NewLayout property of class ProductsCatalog.Shared.Model.ReportConfiguration.Events.ReportConfigurationLayoutSet: 
      An error occurred while deserializing the Nodes property of class ProductsCatalog.Shared.Model.ReportConfiguration.ReportDocumentConfigurationValueObject: 
      No matching creator found..
      

       

      I do not completely understand why it stopped working and I'm worrying because it worked perfectly with older driver.

       

      Gian Maria.

       

       

            Assignee:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Reporter:
            alkampfer@nablasoft.com Gian Maria Ricci
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: