Skip to content

Commit

Permalink
Fix SetState() not work (Azure#44819)
Browse files Browse the repository at this point in the history
* Fix SetState not work

* Fix namespace.

* Add API updates.
  • Loading branch information
JialinXin authored and tejasm-microsoft committed Jul 22, 2024
1 parent 1545921 commit 3593efb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public UserEventResponse() { }
public UserEventResponse(System.BinaryData data, Microsoft.Azure.Functions.Worker.WebPubSubDataType dataType) { }
public UserEventResponse(string data, Microsoft.Azure.Functions.Worker.WebPubSubDataType dataType = Microsoft.Azure.Functions.Worker.WebPubSubDataType.Text) { }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("states")]
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> ConnectionStates { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> ConnectionStates { get { throw null; } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("data")]
public System.BinaryData Data { get { throw null; } set { } }
[System.Text.Json.Serialization.JsonPropertyNameAttribute("dataType")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.ComponentModel;
using System.Linq;
using System.Text.Json.Serialization;
using Microsoft.Azure.WebPubSub.Common;

namespace Microsoft.Azure.Functions.Worker
{
Expand Down Expand Up @@ -35,6 +36,7 @@ internal override WebPubSubStatusCode StatusCode
/// The connection states.
/// </summary>
[JsonPropertyName("states")]
[JsonConverter(typeof(ConnectionStatesConverter))]
public IReadOnlyDictionary<string, BinaryData> ConnectionStates => _states;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using Microsoft.Azure.WebPubSub.Common;

namespace Microsoft.Azure.Functions.Worker
{
Expand Down Expand Up @@ -36,7 +37,8 @@ internal override WebPubSubStatusCode StatusCode
/// The connection states.
/// </summary>
[JsonPropertyName("states")]
public IReadOnlyDictionary<string, BinaryData> ConnectionStates { get; set; }
[JsonConverter(typeof(ConnectionStatesConverter))]
public IReadOnlyDictionary<string, BinaryData> ConnectionStates => _states;

/// <summary>
/// Message.
Expand Down

0 comments on commit 3593efb

Please sign in to comment.