[ESP32][IDF] Guru Mediation when WiFi router is down

My ESP32 is running on batteries. I am using mDash 1.2.14-idf, IDF 3.3.5, with heap and stack debugging turned on. In case the router is down and WiFi is inaccessible, the following two things happen (there might be connected, therefore I put them into single topic):

  1. Although I have registered for the network lost event with
    mDashRegisterEventHandler(MDASH_EVENT_NETWORK_CONNECTED, onConnectedNet, this);
    mDashRegisterEventHandler(MDASH_EVENT_NETWORK_LOST, onDisconnected, this);,

my onDisconnected is never called. I see the following in the log:

2021-05-12 15:15:06  I mDash.c:119:dev_cb        disconnected, ram 115068
I (396432) MDash: Connected to Network (printed by onConnectedNet)
  1. After certain time (minutes), my software crashes with the message given below. It is reproducible, it is just matter of time. On the device side, in the meantime the software tries to send messages to mDash cloud via mDashNotify as the disconnected event never arrived. Any clue?

     2021-05-12 15:15:21    mDash.c:203:timercb       ram: 117784, 2 0x3ffd75ac/0x0/0x3ffd7068
     2021-05-12 15:15:21  I mDash.c:11Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
     Core 0 register dump:
     PC      : 0x4019482e  PS      : 0x00060130  A0      : 0x80196188  A1      : 0x3ffd0fc0
     0x4019482e: mg_ws_send at /Users/lsm/src/cesanta.com/alib/src/ws.c:90
    
     A2      : 0x00000000  A3      : 0x3ffd6bd8  A4      : 0x00000074  A5      : 0x00000002
     A6      : 0x3f413a8c  A7      : 0x3f40036c  A8      : 0xffffff80  A9      : 0x3ffd0f50
     A10     : 0x00000074  A11     : 0x3ffd100c  A12     : 0x3f40164f  A13     : 0x0000000d
     A14     : 0x0000000d  A15     : 0x4018ef44  SAR     : 0x00000018  EXCCAUSE: 0x0000001c
     0x4018ef44: mjson_print_dynamic_buf at /Users/lsm/src/cesanta.com/alib/mjson.c:450
    
     EXCVADDR: 0x00000060  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000000
    
     ELF file SHA256: dec080a73e61061d
    
     Backtrace: 0x4019482e:0x3ffd0fc0 0x40196185:0x3ffd0ff0 0x40127005:0x3ffd1050 0x4012704a:0x3ffd10a0 0x4012719e:0x3ffd10d0 0x40127add:0x3ffd1120 0x4011ee95:0x3ffd1150 0x4011fd7c:0x3ffd1180 0x4011fbf8:0x3ffd11b0 0x4008b8bb:0x3ffd11e0
     0x4019482e: mg_ws_send at /Users/lsm/src/cesanta.com/alib/src/ws.c:90
     0x40196185: mDashNotify at /Users/lsm/src/cesanta.com/alib/mDash.c:142`
    

Best regards,
Istvan.