I've got an afterSave
handler in Cloud Code that conditionally calls a custom method.
From my testing, both functions appear to be working exactly as desired. The custom method is skipped appropriately (with confirming console messages looking correct). It is also called appropriately, and the custom method creates a new object exactly as desired.
What's confusing me is that when the custom method IS called, I get something like the following in my Cloud Code log:
Input: {"title":"title","ownerId":"ownerId"}
Result: undefined
Like I said, the values seem to be passed in correctly, and the method seems to run correctly, but I don't understand why I get Result: undefined
.
In the method that is called, I've placed a response.success()
or response.error()
in every pathway that's possible.
So, is this something to worry about?
The custom method is a "fire-and-forget" type of method, so my afterSave
method doesn't wait around for a response. Is that why I'm getting Result: undefined
?