Skip to content

Commit

Permalink
Workaround for provisioning, unsubscribe on very beginning causes dis…
Browse files Browse the repository at this point in the history
…connection, due to absent subscription on the server
  • Loading branch information
imbeacon authored Jan 24, 2025
1 parent 8a4a5c8 commit 25ab590
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Provision.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ class Provision : public IAPI_Implementation {
}

bool Resubscribe_Topic() override {
return Unsubscribe();
// Unsubscription required only if we are currently subscribed to the topic
if (m_provision_callback.Get_Device_Key() != nullptr) {
return Unsubscribe() && m_subscribe_topic_callback.Call_Callback(PROV_RESPONSE_TOPIC);
}
return true;
}

#if !THINGSBOARD_USE_ESP_TIMER
Expand Down

0 comments on commit 25ab590

Please sign in to comment.