From 9b5dfa71dc2e4038552f8a6779282ae8018198b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Feb 2023 15:57:18 +0700 Subject: [PATCH] Add mising connection status error event during token refreshing when WiFi reconnection was disabled. --- library.json | 2 +- library.properties | 2 +- src/FirebaseESP32.h | 10 ++++------ src/signer/Signer.cpp | 18 +++++++++++++----- src/signer/Signer.h | 4 ++-- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/library.json b/library.json index a16d683b..20fdd29b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Firebase ESP32 Client", - "version": "4.3.6", + "version": "4.3.7", "keywords": "communication, REST, esp32, arduino", "description": "The secure, fast and reliable Firebase Realtime database library to read, store, update, delete, listen, backup, and restore data. You can also read and modify the database security rules with this library.", "repository": { diff --git a/library.properties b/library.properties index eeddf33b..c147e428 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=Firebase ESP32 Client -version=4.3.6 +version=4.3.7 author=Mobizt diff --git a/src/FirebaseESP32.h b/src/FirebaseESP32.h index 9714d656..4de7c84f 100644 --- a/src/FirebaseESP32.h +++ b/src/FirebaseESP32.h @@ -1,16 +1,14 @@ #ifndef FIREBASE_CLIENT_VERSION -#define FIREBASE_CLIENT_VERSION "4.3.6" +#define FIREBASE_CLIENT_VERSION "4.3.7" #endif /** - * Google's Firebase Realtime Database Arduino Library for ESP32, v4.3.6 + * Google's Firebase Realtime Database Arduino Library for ESP32, v4.3.7 * - * Created February 7, 2023 + * Created February 14, 2023 * * Updates: - * - Fix access and custom tokens generation is not finished due to exchange process fail. - * - Fix non-ESP devices WiFi reconnection issue. - * - Fix LittleFS error log issue. + * - Add mising connection status error event during token refreshing when WiFi reconnection was disabled. * * * This library provides ESP32 to perform REST API by GET PUT, POST, PATCH, diff --git a/src/signer/Signer.cpp b/src/signer/Signer.cpp index eecd36bc..6ccb1997 100644 --- a/src/signer/Signer.cpp +++ b/src/signer/Signer.cpp @@ -1,9 +1,9 @@ /** - * Google's Firebase Token Management class, Signer.cpp version 1.3.8 + * Google's Firebase Token Management class, Signer.cpp version 1.3.9 * * This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico * - * Created February 7, 2023 + * Created February 14, 2023 * * This work is a part of Firebase ESP Client library * Copyright (c) 2023 K. Suwatchai (Mobizt) @@ -1744,9 +1744,9 @@ void Firebase_Signer::resumeWiFi(FB_TCP_CLIENT *client, bool &net_once_connected #if defined(ESP32) || defined(ESP8266) WiFi.reconnect(); #else - // If config exists, use wifi credentials from config instead of local wifi creds. - // The local wifi creds can be accessed trough FCM class in case legacy API used. - fb_esp_wifi_credentials_t *_wifiCreds = config ? &config->wifi.wifiCreds : &wifiCreds; + // If config exists, use wifi credentials from config instead of local wifi creds. + // The local wifi creds can be accessed trough FCM class in case legacy API used. + fb_esp_wifi_credentials_t *_wifiCreds = config ? &config->wifi.wifiCreds : &wifiCreds; if (_wifiCreds->size() > 0) { @@ -1799,6 +1799,14 @@ bool Firebase_Signer::reconnect() networkChecking = false; + if (!networkStatus && config->signer.tokens.status == token_status_on_refresh) + { + config->signer.tokens.error.message.clear(); + setTokenError(FIREBASE_ERROR_TCP_ERROR_CONNECTION_LOST); + config->internal.fb_last_jwt_generation_error_cb_millis = 0; + sendTokenStatusCB(); + } + return networkStatus; } diff --git a/src/signer/Signer.h b/src/signer/Signer.h index c0edcfd3..cc18a018 100644 --- a/src/signer/Signer.h +++ b/src/signer/Signer.h @@ -1,9 +1,9 @@ /** - * Google's Firebase Token Management class, Signer.h version 1.3.8 + * Google's Firebase Token Management class, Signer.h version 1.3.9 * * This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico * - * Created February 7, 2023 + * Created February 14, 2023 * * This work is a part of Firebase ESP Client library * Copyright (c) 2023 K. Suwatchai (Mobizt)