Try-fix some import of configuration inconsistencies (#6364)

This commit is contained in:
Ben Meadors 2025-03-31 02:54:27 -05:00 committed by GitHub
parent bd2d2981c9
commit 72db671e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,7 +265,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
disableBluetooth(); disableBluetooth();
LOG_INFO("Commit transaction for edited settings"); LOG_INFO("Commit transaction for edited settings");
hasOpenEditTransaction = false; hasOpenEditTransaction = false;
saveChanges(SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS); saveChanges(SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_DEVICESTATE | SEGMENT_CHANNELS | SEGMENT_NODEDATABASE);
break; break;
} }
case meshtastic_AdminMessage_get_device_connection_status_request_tag: { case meshtastic_AdminMessage_get_device_connection_status_request_tag: {
@ -334,7 +334,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
node->position = TypeConversions::ConvertToPositionLite(r->set_fixed_position); node->position = TypeConversions::ConvertToPositionLite(r->set_fixed_position);
nodeDB->setLocalPosition(r->set_fixed_position); nodeDB->setLocalPosition(r->set_fixed_position);
config.position.fixed_position = true; config.position.fixed_position = true;
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); saveChanges(SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false);
#if !MESHTASTIC_EXCLUDE_GPS #if !MESHTASTIC_EXCLUDE_GPS
if (gps != nullptr) if (gps != nullptr)
gps->enable(); gps->enable();
@ -347,7 +347,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
LOG_INFO("Client received remove_fixed_position command"); LOG_INFO("Client received remove_fixed_position command");
nodeDB->clearLocalPosition(); nodeDB->clearLocalPosition();
config.position.fixed_position = false; config.position.fixed_position = false;
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false); saveChanges(SEGMENT_NODEDATABASE | SEGMENT_CONFIG, false);
break; break;
} }
case meshtastic_AdminMessage_set_time_only_tag: { case meshtastic_AdminMessage_set_time_only_tag: {
@ -574,7 +574,6 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
config.has_position = true; config.has_position = true;
config.position = c.payload_variant.position; config.position = c.payload_variant.position;
// Save nodedb as well in case we got a fixed position packet // Save nodedb as well in case we got a fixed position packet
saveChanges(SEGMENT_DEVICESTATE, false);
break; break;
case meshtastic_Config_power_tag: case meshtastic_Config_power_tag:
LOG_INFO("Set config: Power"); LOG_INFO("Set config: Power");