Sign In Register

How can we help you today?

Start a new topic
Answered

Event cloud code not running when called from cloud code module

I recently implemented an event and connected it to a running total so that we could update a leaderboard. I then added some cloud code to that event to update an entry in a collection. 


What I've found is that, when calling this event via the test harness, the leaderboard is updated as expected and the cloud code is executed, hence updating the collection as expected. However, when I log an event request to this same event via cloud code, only the leaderboard is updated. Below is how I am making the event request.


    var req = new SparkRequests.LogEventRequest();

    req.eventKey = "eventName";

    req.data = data;

    var result = req.Send();


Is this a known bug, or am I doing something wrong?



Best Answer

Hi Joshua


Cloud code is not executed on requests sent from cloud code, this restriction is currently in place to stop infinite loops that could occur.


I've updated the SparkRequests documentation to make this clear.


Gabriel


Answer

Hi Joshua


Cloud code is not executed on requests sent from cloud code, this restriction is currently in place to stop infinite loops that could occur.


I've updated the SparkRequests documentation to make this clear.


Gabriel

Good to know. Thanks for the quick response!

Login to post a comment