Skip to content

Fix Publishing bool, int and float data types #1316

Description

@sacOO7
  • According to the UnsupportedTypes defined in MessageHandler.cs, the following types are currently not supported as values for the data argument in publish:
private static readonly Type[] UnsupportedTypes =
{
    typeof(short), typeof(int), typeof(double), typeof(float), typeof(decimal), typeof(DateTime), typeof(DateTimeOffset), typeof(byte), typeof(bool),
    typeof(long), typeof(uint), typeof(ulong), typeof(ushort), typeof(sbyte),
};
  • As a result, the following calls will fail:

    1. channel.PublishAsync("test", true);
    2. channel.PublishAsync("test", 10);
    3. channel.PublishAsync("test", 10.4);
  • These types are accepted in ably-js and other client libraries, so we should explore how to align .NET behavior accordingly in the near future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions