Losing Spark.subscribe() connection/subscription

I attempted to use the code you provided as-is (including adding extern at the top of the file and all that) in the code I had, and as soon as I shut off my router the Spark Core started blinking green as if it was already attempting to connect to the Wi-Fi network, and stayed that way even after the internet was restored and the other Spark Core had gone through it's normal re-connect. (The green flashing didn't stop until I RESET the core and then it connected normally and functionality returned to normal.)

After that didn't work, I figured it had something to do with how I simply dropped what you had into my loop without changing anything, so I moved the bracket down to include the second part:

void loop() { ...

   static bool prev_connected = true;
   bool connected = Spark.connected();
   if (connected && !prev_connected) {
       spark_protocol.send_subscription("light-up", SubscriptionScope::MY_DEVICES);
         //moved it from here
   prev_connected = connected;
   if (!connected)
      Spark.connect();
     }   // to here

// rest of the stuff I have going on etc
}

After resetting my router again, the status LED seemed to go through the normal steps except that it wasn't registering the publish event I had subscribed to anymore (stopped functioning just the same way it did during the first test I did before changing any code).

I noticed that in the spark_protocol.send_subscription("eventName", SubscriptionScope::MY_DEVICES);
that there isn't any space for setting up a handler (and it gave me an error when I tried to just add a comma and throw it in there). In my original code in void setup, I have

Spark.subscribe("light-up", ledOn, MY_DEVICES);

Where ledOn hooks up to a handler which does the stuff I want it to do, which I'm assuming is why it wouldn't work when re-connecting (I don't see a way for it to hook up with the handler in setup?)