I have encountered a very strange issue on a realm function. My function uses the latest axios library to make a POST request to another server. On that server, I know that the request is completing successfully. I have had to add log statements right before the response gets sent, and I can see those statements being logged, so I know the request is successful and being sent back to the realm function context. Also, when testing in postman, this same POST request succeeds no problem. So I KNOW the axios call should resolve. However, it does not resolve. Below is the function code making the call:
const url = context.values.get("secret_url") + "/endpoint";
const data = {
number_recommendations: 400,
interests: profile,
price_min: price_min || 10,
price_max: price_max || 500,
};
const config = {
method: "post",
url,
headers: {
"Content-Type": "application/json",
},
data,
};
const recommendationsRequest = await axios(config);
I’ve tried logging and nothing happens after the axios await.
Anybody had similar issues? Seems like a bug with realm perhaps.