Publish after Network Connection

I’m working on some code that will queue events that occur when the device is not connected to the network for whatever reason.

I’m successfully determining that I’m offline by checking Particle.connected, but I’m finding that as I’m coming back online, Particle.connected starts to register true but for a period of maybe a minute or so, any Publish events that I send will return as if they’ve sent successfully, but any subscribers will not see the event. It seems to be Electron specific, as I don’t see the same problem when running on a Photon.

I could just wait for some period of time after reconnecting, but I’d rather some more robust way to determine that the device is ready to publish. Is anyone else seeing something similar? Can anyone provide some guidance about how I can better determine when it’s safe to publish?