Skip to content

Commit 267c035

Browse files
committed
fix Skoda MQTT: stop reconnect loop on 'Not authorized' server error
Known Skoda server-side issue (skodaconnect/myskoda#554, homeassistant-myskoda#1062). On 'Not authorized', stop the client immediately instead of reconnecting endlessly or triggering token refresh loops. Next scheduled token refresh (every 54min) will retry connectMqtt() with fresh credentials.
1 parent 78a3a91 commit 267c035

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,9 +2981,8 @@ class VwWeconnect extends utils.Adapter {
29812981
this.mqttClient.on("error", (error) => {
29822982
this.log.error("MQTT Error: " + error);
29832983
if (error && error.message && error.message.includes("Not authorized")) {
2984-
this.log.info("MQTT: Not authorized - triggering token refresh");
2984+
this.log.info("MQTT: Not authorized - stopping reconnect. Will retry on next token refresh.");
29852985
this.mqttClient.end();
2986-
this.refreshSkodaEToken().catch(() => {});
29872986
}
29882987
});
29892988
this.mqttClient.on("close", () => {

0 commit comments

Comments
 (0)