[SOLVED] Cloud Flashing hardly works when this program is loaded

So just looking at this part of your issue... I'm wondering how long the Spark Web IDE will attempt to send a message to the Core to reprogram it before giving up. If it's less time than a few seconds, the ability of the Core to receive this signal is blocked by the client.connect() code. @satishgn can you comment on these times?

If so, you could circumvent this problem by adding in a forced reprogram mode like this: