sefidgaran / signalr_client

A Flutter SignalR Client for ASP.NET Core
https://pub.dev/packages/signalr_netcore
MIT License
71 stars 111 forks source link

DateTime/DateTimeOffset not supported??? #58

Open JCKodel opened 1 year ago

JCKodel commented 1 year ago

At server, the following structure is serialized:

new Dictionary<string, object> {
  { "string", "Hello" },
  { "dateTime", DateTime.Now() },
};

On client, the response of that invocation is a Map<dynamic, dynamic> with:

{
  "string": "Hello,
  "dateTime": null,
}

The deserializer got a 0xd7 type, then a 0xff subtype (I guess -1 is considered 255), on this method:

dynamic _readExt(int length) {
  final extType = _readUInt8();
  final data = _readBuffer(length);
  return _extDecoder?.decodeObject(extType, data);
}

At that time, _extDecoder was null, so null was returned.

AntonEriksson978 commented 3 months ago

I also have this problem. But its, as you say, a problem in the messagepack repo.