Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/browser/mqtt5_utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ function create_base_expected_mqtt_js_config() : mqtt.IClientOptions {
autoAssignTopicAlias : false,
transformWsUrl: undefined, /* TOFIX */
resubscribe : false,
clientId : ""
};
}

Expand Down
6 changes: 3 additions & 3 deletions lib/browser/mqtt5_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ export function create_mqtt_js_client_config_from_crt_client_config(crtConfig :
}

/*
* If you leave clientId undefined, mqtt-js will make up some weird thing for you, but the intent is that it
* should pass the empty client id so that the server assigns you one.
* MQTT.js treats an undefined client id specially, and we want it to do so, otherwise it will refuse
* to connect with clean session false
*/
utils.set_defined_property(mqttJsClientConfig, "clientId", crtConfig.connectProperties?.clientId ?? "");
utils.set_defined_property(mqttJsClientConfig, "clientId", crtConfig.connectProperties?.clientId);
utils.set_defined_property(mqttJsClientConfig, "username", crtConfig.connectProperties?.username);
utils.set_defined_property(mqttJsClientConfig, "password", crtConfig.connectProperties?.password);
utils.set_defined_property(mqttJsClientConfig, "will", create_mqtt_js_will_from_crt_config(crtConfig.connectProperties));
Expand Down