diff --git a/ChangeLog.txt b/ChangeLog.txt index a0614d894b..5a165de1a3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -22,6 +22,8 @@ Broker: security plugin. Closes #2525. - Fix confusing error message when dynamic security config file was a directory. Closes #2520. +- Fix bridge queued messages not being persisted when local_cleansession is + set to false and cleansession is set to true. Closes #2604. Client library: - Fix threads library detection on Windows under cmake. Bumps the minimum diff --git a/src/persist_write.c b/src/persist_write.c index 0df016ec0c..fb3632feec 100644 --- a/src/persist_write.c +++ b/src/persist_write.c @@ -167,7 +167,11 @@ static int persist__client_save(FILE *db_fptr) memset(&chunk, 0, sizeof(struct P_client)); HASH_ITER(hh_id, db.contexts_by_id, context, ctxt_tmp){ - if(context && context->clean_start == false){ + if(context && (context->clean_start == false +#ifdef WITH_BRIDGE + || (context->bridge && context->bridge->clean_start_local == false) +#endif + )){ chunk.F.session_expiry_time = context->session_expiry_time; if(context->session_expiry_interval != 0 && context->session_expiry_interval != UINT32_MAX && context->session_expiry_time == 0){ chunk.F.session_expiry_time = context->session_expiry_interval + db.now_real_s;