We are extensively using Realm triggers to sync relevant data from MongoDB to Algolia for search purposes. But some of the documents fail to sync. From the logs, we noticed it for documents with strings which contain emoji characters in them. So suppose there is a collection called
post which consists of
post.title would result in failure of the trigger if
title has an emoji in the string.
We have two clusters setup - prod and dev. The above behaviour is not reproducible for Realm app belonging to dev cluster but it is reproducible for prod cluster.
We try logging the error in
catch block like so -
console.log(JSON.stringify(err)) but it just results in
"[object Object]" string like so :-
I don’t think this is an error at Algolia end since, we are able to sync all such fields with emoji content using external scripts. Not sure, why this is only happening for the prod cluster and ways to mitigate this.
Did stumble on utf-validation bit but not sure how to disable it for trigger based function calls. Also not sure if that is the issue but seems like closest bet.
☎ is allowed to sync but
☎️ isn’t. The second one has char length of two while first doesn’t. This doesn’t happen for dev cluster though. Also
⏱️ syncs without any issue even though it has char length of 2.