question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AddSubscription is broken by WhereEqualTo

See original GitHub issue

Summary

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

  1. (preferable) The subscription is successful and we get updates based on the query.
  2. A warning stating that the WhereEqualTo is not compatible with AddSubscription and was ignored.

Result

OnGeneralMessageEvent reports “Received message $error” OnErrorEvent returns:

em.code 1 em.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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
christopher-r-brechcommented, Mar 8, 2022

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.

0reactions
Oberhaimcommented, Jun 17, 2022

Hi there, Any fix to WhereEqualTo ? Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

AddSubscription is broken by WhereEqualTo · Issue #74
AddSubscription, there seems to be a breakdown somewhere between the SDK and the Moralis server. The subscription fails and errors are returned.
Read more >
Firestore Query whereEqualTo along with ...
Firestore whereEqualTo, orderBy and limit(1) not working (1 answer). Closed 2 years ago. When I query whereEqualTo with whereGreaterThan :
Read more >
SOLVED Firestore WhereEqualto not Found
Hello everyone! For some reason, this type of query is not working for me. I test with Wherewqualto2 and whereEqualToString. Returns all records ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found