You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using mqtt::connect_options_builder::set_properties, the mqtt::connect_options::opts_::connectProperties member is NULL after calling finalize. I believe there's some kind of bug present in the copy constructor/assignment for mqtt::connect_options.
// This does not work (conn_opts1.opts_.connectProperties == NULL)
mqtt::properties conn_props{mqtt::property{mqtt::property::SESSION_EXPIRY_INTERVAL, 600000}};
constauto conn_opts1 = mqtt::connect_options_builder().properties(conn_props).finalize();
// Works
mqtt::connect_options conn_opts2;
conn_opts2.set_properties(conn_props);
// Works
mqtt::connect_options conn_opts3(conn_opts2);
Environment Info:
Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.4 (Version 17.4.7)
Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
MSVC_VERSION 1934 (v143 toolset)
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. I think I see what might be missing. First I'd like to try and write a unit test that catches the bug. Then I'll try the fix and and make sure I got it.
I stumbled across the same problem and tried to fix it already, only now also found the issue - definitely an issue in the constructors. PR in #445 should resolve it, let me know if further updates are needed.
I put in a simple unit test to check this, but I did so after I had already merged #445. The unit test is passing, so I will assume that it was #445 that fixed it, and close this.
When using
mqtt::connect_options_builder::set_properties
, themqtt::connect_options::opts_::connectProperties
member is NULL after calling finalize. I believe there's some kind of bug present in the copy constructor/assignment for mqtt::connect_options.Environment Info:
Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.4 (Version 17.4.7)
Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
MSVC_VERSION 1934 (v143 toolset)
The text was updated successfully, but these errors were encountered: