Add asserts in connection_invalidated_cb