hello there,
it echoes the response before it sends the email and even then the emails still get sent, implying that it processed everything correctly. I dont really send anything complicated just a set of numbers separated by commas which is then URL encoded.
The problem is that it works 80% of the time and 20% of the time corona does not receive a network event. This is a critical problem because the server is actually receiving the information, implying that corona is losing the data some how.
I print all objects in event and i receive nothing yet the email gets sent, the php script also is fool proof as the output is basically as follows.
Echo "{success}";
sendEmail();
I don’t know if this is a bug or a source of the problem but my function is part of a table listener which is as follows:
[code]
A.magic_handler = function(event)
local xml = xmlParser.newParser()
if A.type ~= “TheStore” and A.type ~= “ShoppingList” then
print_r(event)
end
local test_for_error = string.sub(event.response,1,1)
if event.isError then
local function onComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
A:Request({A.type})
print(“YES”)
end
end
end
A.requestTypes[A.type].isError = true
A.requestTypes[A.type].isProcessing = false
if A.requestTypes[A.type].overide then
else
native.showAlert(“Connection”,“Network Timeout, please try again”, {“Try Again”},onComplete)
timer.performWithDelay(1000,A:Request({A.type}) )
end
elseif test_for_error ~= “{” then
A.requestTypes[A.type].isError = true
A.requestTypes[A.type].isProcessing = false
print(“OK”)
– print_r(event)
native.showAlert(“Bad Code”,“There was an issue with our server, tell RYAN that “”…A.type…”.php" is not working! Send him this very message: “…event.response, {“OK”})
elseif event.status == 500 then
A.requestTypes[A.type].isError = true
A.requestTypes[A.type].isProcessing = false
print(“OK”)
– print_r(event)
native.showAlert(“Very Bad Code”,“There was an issue with our server, tell RYAN that “”…A.type…”.php” is not working at all!!!", {“OK”})
else
A.requestTypes[A.type].isError = false
local response = json.decode(event.response
if response.Type == “TheStore” then
A.parse_for_TheStore( response )
elseif response.Type == “ShoppingList” then
A.parse_for_ShoppingList( response )
elseif response.Type == “AroundMe” then
A.parse_for_AroundMe( response )
elseif response.Type == “Confirmation” then
A.parse_for_Confirmation(response)
elseif A.type == “prizes” then
A.parse_for_prizes( event.response )
elseif A.type == “rankings” then
A.parse_for_rankings( response,event.response )
elseif A.type == “login” then
–the response is not in xml so just pass in the response
A.parse_for_login( event.response )
elseif A.type == “last pick” then
A.parse_for_lastpick(response,event.response)
elseif A.type == “past performance” then
A.parse_for_performance(response,event.response)
elseif A.type == “submission” then
A.parse_for_submission_response(response,event.response)
elseif A.type == “busy” then
A.parse_for_busy(response,event.response)
elseif A.type == “action_box” then
print(“action_box function switch”)
A.parse_for_action_box(response,event.response)
elseif A.type == “notifications” then
end
end
end
[/code] [import]uid: 100738 topic_id: 33610 reply_id: 133618[/import]