Hi,
Really struggling with something that "works unless..."
I have narrowed it down to after my makeWebRequest call in a background ServiceDelegate (yes, this is a WF).
I have done exhaustive .println() everywhere and I can confirm that everything is as I would expect up until the bug.
EG: I have something like this:
(:background) class ServiceManagerDelegate extends System.ServiceDelegate { function onTemporalEvent() { var comms = new Dostuff(); var responseCallback = method(:onReceive); // set responseCallback to onReceive() method var callData = Storage.getValue("nextCall"); comms.doIt(responseCallback,callData); } function onReceive(responseCode,data) { var response = {"type"=>"onTemporalEvent"}; if(responseCode != 200) { response["error"] = responseCode; } else { response["data"] = data; } Background.exit(response); } } ///////////// (:background) class Dostuff { function initialize() { } function doIt(callback,details) { var cb = callback; System.println("NEXT CALL "+details); var identifier = details[0]; var url = details[1]; var payload = details[2]; var isPost = details[3]; var options = { :method => isPost ? Communications.HTTP_REQUEST_METHOD_POST : Communications.HTTP_REQUEST_METHOD_GET, :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON, }; System.println("URL: "+ url); System.println("PAYLOAD IS: "+payload); System.println(payload == null); System.println("POST: "+isPost); System.println("OPTIONS: "+options); Communications.makeWebRequest(url, payload, options, cb); } }
If I set Storage "nextCall" at the very beginning and leave it, everything is fine. It all works.
But...
As soon as I change the "nextCall" value in Storage I see:
Error: Symbol Not Found Error Details: Failed invoking <symbol> Stack:
Yep, that really is everything - no line number, no clues.
This happens a few seconds after my makeWebRequest so it looks as if it is the method(:receiveCallback) that is failing.
So...
Has garbage collector cleaned up my callback or something?
This one is horrid.
G