AddSubscription is broken by WhereEqualTo
See original GitHub issueSummary
When feeding a query with .WhereEqualTo("key", value)
to MoralisLiveQueryController.AddSubscription, there seems to be a breakdown somewhere between the SDK and the Moralis server. The subscription fails and errors are returned.
Background
In our JavaScript version of our code, we use .equalTo
in our subscription. While I am not completely confident this has been doing what I expected, I do know that the subscription is still successful.
Being able to only receive updates when specific entries in a Class are updated allows us to maintain only a single subscription per user.
Code
var query = MoralisInterface.GetClient().Query<MyMoralisClass>().WhereEqualTo("roomId", roomId);
MoralisLiveQueryController.AddSubscription("MyMoralisClass", query, callbacks);
Expected
Either
- (preferable) The subscription is successful and we get updates based on the query.
- A warning stating that the WhereEqualTo is not compatible with AddSubscription and was ignored.
Result
OnGeneralMessageEvent reports “Received message $error” OnErrorEvent returns:
em.code
1em.error
Invalid type: string (expected object)em.requestId
And the Moralis Dashboard Logs show:
2022-03-02T17:26:48.413Z - Connect message error %s
Miscellaneous Info
- Using just
MoralisInterface.GetClient().Query<MyMoralisClass>()
works, but is not ideal. - All of our regular queries using .WhereEqualTo work as expected.
- This issue is in reference to a Windows build as we use JavaScript-based code for our WebGL builds. I will update this issue if I see the same problem when using MoralisInterface with UNITY_WEBGL defined.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
This issue occurs in Windows standalone builds.
When we build in WebGL we do not depend on this repo yet.
I will pass the suggestion to update on to my team.
My team and I appreciate your taking the time to look into this issue.
Hi there, Any fix to WhereEqualTo ? Thanks