Coder Social home page Coder Social logo

Comments (5)

rogeralsing avatar rogeralsing commented on August 14, 2024 2

I will continue to dig in this.
It could be that Wire incorrectly encodes the type of the payload as the interface type, and once it tries to deserialize, it might try to create an instance of the interface.
Which is ofcourse not possible.

I will keep updating here.

from wire.

kantora avatar kantora commented on August 14, 2024

And what is wrong always work only with contents end-types (not declared field/property types)?

from wire.

rogeralsing avatar rogeralsing commented on August 14, 2024

It uses both the field type and the content type.

  • if they both match, it can optimize the flow.
  • If they differ, there is another path.

the problem currently with the interfaces in the fields, is that the code generator tries to do things that are not possible on an interface type.

from wire.

rogeralsing avatar rogeralsing commented on August 14, 2024

I have added tests for this,
The tests however pass and the interface field is serialized just fine.
I need to create tests for the specific messages in Akka.NET that uses interface fields to see why that fails.

from wire.

kantora avatar kantora commented on August 14, 2024

Maybe this can help. I've made some local modification in Wire to make exceptions give more data and managed to trace the problem.

Akka.Cluster.Tools.PublishSubscribe.Internal.Bucket has the field public readonly IImmutableDictionary<string, ValueHolder> Content.

The problem is in the Wire.SerializerFactories.ImmutableCollectionsSerializerFactory.BuildSerializer.

            var typeName = type.Name;
            var genericSufixIdx = typeName.IndexOf('`');
            typeName = genericSufixIdx != -1 ? typeName.Substring(0, genericSufixIdx) : typeName;
            var creatorType =
                Type.GetType(
                    ImmutableCollectionsNamespace + "." + typeName + ", " + ImmutableCollectionsAssembly, true);

For this field creatorType tries to load type System.Collections.Immutable.IImmutableDictionary, System.Collections.Immutable and there is no such type (Type load exception).

Unfortunately, I don't have enough understanding of the code to get the meaning of such type name conversion (as you are not guaranteed to have a type with the same name as generic, but without generic parameters).

from wire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.