Skip to content

Commit

Permalink
Add mising connection status error event during token refreshing when…
Browse files Browse the repository at this point in the history
… WiFi reconnection was disabled.
  • Loading branch information
mobizt committed Feb 14, 2023
1 parent cd551c1 commit 9b5dfa7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=Firebase ESP32 Client

version=4.3.6
version=4.3.7

author=Mobizt

Expand Down
10 changes: 4 additions & 6 deletions src/FirebaseESP32.h
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
18 changes: 13 additions & 5 deletions src/signer/Signer.cpp
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/signer/Signer.h
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 9b5dfa7

Please sign in to comment.