Fix the Newer 3MF Warning for Alpha and Beta Projects in Nightlies (#16791)

# Description
<!--
> Please provide a summary of the changes made in this PR. Include
details such as:
  > * What issue does this PR address or fix?
  > * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be
considered?
-->

Fixes #16771. Opening a project saved by 2.5.0-alpha in a nightly shows
"The 3MF file version 2.5.0-alpha is newer than OrcaSlicer's version
2.5.0-dev, found the following unrecognized keys:", followed by an empty
list.

Three things cause this:

- `semver.c` ranks `dev` below every other prerelease. Nightlies stay on
`x.y.z-dev` after the alpha and beta are tagged on the release branch,
so every alpha or beta project looked newer than the nightly opening it.
- `silent_mode` was retired: `handle_legacy` drops it on load, and
nothing can set it. It was still defined, though, so it was written into
every project. Every project then reported it as an unrecognized key on
load, and every project from a newer version took the "unrecognized
keys" branch of the warning. For the project in the issue it is the only
key reported.
- The warning never printed the keys it found, so the list was blank.

## Changes

- Rank `dev` above the other prereleases of the same version and below
the release: alpha < beta < rc < dev < release. This also changes two
other places that compare against the app's version:
- A project saved by a `x.y.z-dev` nightly now counts as newer when
opened in that version's alpha or beta.
- The update check, with prereleases enabled, no longer offers that
version's alpha or beta to nightly users. It still offers the release.
- Remove the `silent_mode` option, so projects no longer save it, along
with the code that only read it: the Normal/Silent columns on the
printer's Motion ability page, the Normal/Silent label in the
unsaved-changes dialog, and the switch that enabled the stealth time
estimator. Since the value was always false, none of these ran. The key
stays in the obsolete set, so older projects that contain it still load.
- List the unrecognized keys in the newer-version warning. The UI
strings are unchanged, so existing translations stay valid.

Projects saved before this change still carry `silent_mode`, so the
warning lists it when one of them is newer than the running version.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
Before:
<img width="860" height="200" alt="before"
src="https://github.com/user-attachments/assets/5d067ae1-5cfb-40b4-8973-3ac10cf2aeb9"
/>

After:
<img width="860" height="200" alt="after"
src="https://github.com/user-attachments/assets/2ef2401e-e869-4ae8-84f6-8730494c13c0"
/>

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

- New `[Semver]` cases: dev ranks above alpha, beta and rc and below the
release of its version; two dev builds compare equal. They fail without
the `semver.c` change.
- New `[Config]` case: a full config has no `silent_mode`, and loading
one that has it drops it and reports it as unrecognized.
- On Linux, loaded the project from the issue in a `2.5.0-dev` build.
Before: the warning with an empty list. After: no warning. The same
project relabelled as 2.5.0 and given an unknown key shows the warning
listing that key and `silent_mode`.
- Re-saved the project from the CLI: `silent_mode` is no longer in
`project_settings.config`.
- Sliced the project before and after: identical moves and time
estimates; only the settings comments differ.
- `tests/libslic3r` and `tests/fff_print` pass on Linux. The STEP case
"A cone with a slightly tilted seam imports as a closed mesh" fails
locally on main too. The profile tool tests pass.

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
This commit is contained in:
SoftFever authored and GitHub committed 2026-10-23 18:47:11 +08:00
commit 30ceeee18d
15 files changed
+64 -96

No files matched your search

+4 -2
View File
@@ -224,12 +224,14 @@ compare_prerelease (char *x, char *y) {
if (x == NULL && y) return 1;
// Orca: Special handling for 'dev'
// Nightly builds stay on x.y.z-dev after the alpha and beta are tagged, so 'dev'
// ranks above every other prerelease and below the release.
if (strcmp(x, "dev") == 0 && strcmp(y, "dev") == 0)
return 0;
if (strcmp(x, "dev") == 0 && strcmp(y, "dev") != 0)
return -1;
if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0)
return 1;
if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0)
return -1;
lastx = x;
lasty = y;
+2 -7
View File
@@ -3092,11 +3092,9 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
// free functions called by GCode::_do_export()
namespace DoExport {
static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor, bool& silent_time_estimator_enabled,
static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor,
const std::shared_ptr<MultiNozzleUtils::NozzleGroupResultBase>& nozzle_group_result = nullptr)
{
silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlinLegacy || config.gcode_flavor == gcfMarlinFirmware)
&& config.silent_mode;
processor.reset();
// Slot-resolution context for the streaming replay (reset() just cleared it). This is NOT
// the post-stream result-field handover at the end of do_export, which gates the richer
@@ -3105,7 +3103,6 @@ namespace DoExport {
processor.initialize_result_moves();
processor.apply_config(config);
processor.configure_exclusion_volume_path_check(config);
processor.enable_stealth_time_estimator(silent_time_estimator_enabled);
}
#if 0
@@ -3397,9 +3394,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// init as filament map
update_layer_related_config(0);
// modifies m_silent_time_estimator_enabled
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled,
print.get_layered_nozzle_group_result());
DoExport::init_gcode_processor(print.config(), m_processor, print.get_layered_nozzle_group_result());
set_mass_locator(m_processor, print);
const bool is_bbl_printers = print.is_BBL_printer();
const bool skip_config_block = print.config().gcode_skip_config_block;
-2
View File
@@ -248,7 +248,6 @@ public:
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
m_brim_done(false),
m_second_layer_things_done(false),
m_silent_time_estimator_enabled(false),
m_last_obj_copy(nullptr, Point(std::numeric_limits<coord_t>::max(), std::numeric_limits<coord_t>::max())),
// BBS
m_toolchange_count(0),
@@ -911,7 +910,6 @@ protected:
int m_timelapse_warning_code = 0;
bool m_support_traditional_timelapse = true;
bool m_silent_time_estimator_enabled;
Print *m_print{nullptr};
-13
View File
@@ -3652,14 +3652,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
DEFAULT_TRAVEL_ACCELERATION;
}
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) {
const ConfigOptionBool* silent_mode = config.option<ConfigOptionBool>("silent_mode");
if (silent_mode != nullptr) {
if (silent_mode->value && m_time_processor.machine_limits.machine_max_acceleration_x.values.size() > 1)
enable_stealth_time_estimator(true);
}
}
const ConfigOptionFloat* initial_layer_print_height = config.option<ConfigOptionFloat>("initial_layer_print_height");
if (initial_layer_print_height != nullptr)
m_first_layer_height = std::abs(initial_layer_print_height->value);
@@ -3699,11 +3691,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
ensure_nozzle_group_result(static_cast<int>(m_result.filaments_count));
}
void GCodeProcessor::enable_stealth_time_estimator(bool enabled)
{
m_time_processor.machines[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].enabled = enabled;
}
void GCodeProcessor::reset()
{
m_units = EUnits::Millimeters;
-1
View File
@@ -1425,7 +1425,6 @@ inline constexpr float DEFAULT_FILAMENT_DENSITY = 1.245f;
DynamicConfig export_config_for_render() const;
void enable_stealth_time_estimator(bool enabled);
bool is_stealth_time_estimator_enabled() const {
return m_time_processor.machines[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].enabled;
}
-1
View File
@@ -1583,7 +1583,6 @@ static std::vector<std::string> s_Preset_printer_options {
"printable_height", "extruder_printable_height", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "extruder_clearance_dist_to_rod",
"nozzle_height", "master_extruder_id",
"default_print_profile", "inherits",
"silent_mode",
"scan_first_layer", "enable_power_loss_recovery", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode",
"nozzle_type", "nozzle_hrc","auxiliary_fan", "fan_direction", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","support_cooling_filter","cooling_filter_enabled","printer_structure","farthest_point_timelapse",
"best_object_pos", "head_wrap_detect_zone",
-6
View File
@@ -5290,12 +5290,6 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionString(""));
def = this->add("silent_mode", coBool);
def->label = L("Silent Mode");
def->tooltip = L("Whether the machine supports silent mode in which machine uses lower acceleration to print more quietly");
def->mode = comDevelop;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("emit_machine_limits_to_gcode", coBool);
def->label = L("Emit limits to G-code");
def->category = L("Machine limits");
-1
View File
@@ -1836,7 +1836,6 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionStrings, filament_change_extrusion_role_gcode))
((ConfigOptionFloatsNullable, travel_speed))
((ConfigOptionFloatsNullable, travel_speed_z))
((ConfigOptionBool, silent_mode))
((ConfigOptionString, machine_pause_gcode))
((ConfigOptionString, template_custom_gcode))
//BBS
+4 -9
View File
@@ -9283,12 +9283,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
if (config_substitutions.unrecogized_keys.size() > 0) {
wxString text = wxString::Format(_L("The 3MF file version %s is newer than %s's version %s, found the following unrecognized keys:"),
file_version.to_string_sf(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string_sf());
text += "\n";
wxString context = text;
wxString append = _L("You should update your software.\n");
context += "\n\n";
context += append;
log_and_show_3mf_info(context, newer_3mf_title);
text += "\n" + from_u8(boost::algorithm::join(config_substitutions.unrecogized_keys, ", ")) + "\n\n";
text += _L("You should update your software.\n");
log_and_show_3mf_info(text, newer_3mf_title);
}
else {
//if the minor version is not matched
@@ -9346,9 +9343,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
else if (load_config) {
// Logged, not shown: it is the same for every BambuStudio project and needs no action.
std::string unrecognized;
for (const std::string& key : config_substitutions.unrecogized_keys)
unrecognized += (unrecognized.empty() ? "" : ", ") + key;
const std::string unrecognized = boost::algorithm::join(config_substitutions.unrecogized_keys, ", ");
BOOST_LOG_TRIVIAL(info) << "BambuStudio " << file_version.to_string() << " project " << path.string()
<< ", unrecognized settings: " << (unrecognized.empty() ? "none" : unrecognized);
}
+8 -48
View File
@@ -5829,9 +5829,7 @@ void TabPrinter::append_option_line(ConfigOptionsGroupShp optgroup, const std::s
auto line = Line{ option.opt.full_label, "" };
line.label_path = label_path;
line.append_option(option);
if (m_use_silent_mode
|| m_printer_technology == ptSLA // just for first build, if SLA printer preset is selected
)
if (m_printer_technology == ptSLA) // just for first build, if SLA printer preset is selected
line.append_option(optgroup->get_option(opt_key, 1));
optgroup->append_line(line);
}
@@ -5840,29 +5838,6 @@ PageShp TabPrinter::build_kinematics_page()
{
auto page = add_options_page(L("Motion ability"), "custom-gcode_motion", true); // ORCA: icon only visible on placeholders
if (m_use_silent_mode) {
// Legend for OptionsGroups
auto optgroup = page->new_optgroup("");
auto line = Line{ "", "" };
ConfigOptionDef def;
def.type = coString;
def.width = Field::def_width();
def.gui_type = ConfigOptionDef::GUIType::legend;
def.mode = comDevelop;
//def.tooltip = L("Values in this column are for Normal mode");
def.set_default_value(new ConfigOptionString{ _(L("Normal")).ToUTF8().data() });
auto option = Option(def, "full_power_legend");
line.append_option(option);
//def.tooltip = L("Values in this column are for Stealth mode");
def.set_default_value(new ConfigOptionString{ _(L("Silent")).ToUTF8().data() });
option = Option(def, "silent_legend");
line.append_option(option);
optgroup->append_line(line);
}
auto optgroup = page->new_optgroup(L("Advanced"), "param_advanced");
optgroup->append_single_option_line("emit_machine_limits_to_gcode", "printer_motion_ability#emit-limits-to-g-code");
@@ -5962,13 +5937,9 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
size_t existed_page = 0;
for (size_t i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already
if (m_pages[i]->title().find(L("Motion ability")) != std::string::npos) {
if (m_rebuild_kinematics_page)
m_pages.erase(m_pages.begin() + i);
else
existed_page = i;
existed_page = i;
break;
}
m_rebuild_kinematics_page = false;
if (existed_page < n_before_extruders && (is_marlin_flavor || from_initial_build)) {
auto page = build_kinematics_page();
@@ -6957,13 +6928,9 @@ void TabPrinter::toggle_options()
const bool gcf_is_klipper = gcf == GCodeFlavor::gcfKlipper;
const bool gcf_is_reprap_firmware = gcf == GCodeFlavor::gcfRepRapFirmware;
bool silent_mode = m_config->opt_bool("silent_mode");
int max_field = silent_mode ? 2 : 1;
for (int i = 0; i < max_field; ++i)
toggle_option("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper, i);
toggle_option("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper, 0);
toggle_line("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper);
for (int i = 0; i < max_field; ++i)
toggle_option("machine_max_junction_deviation", gcf_is_marlin_firmware, i);
toggle_option("machine_max_junction_deviation", gcf_is_marlin_firmware, 0);
toggle_line("machine_max_junction_deviation", gcf_is_marlin_firmware);
// Check if junction deviation value is non-zero and firmware is Marlin
@@ -6977,12 +6944,10 @@ void TabPrinter::toggle_options()
enable_jerk = true;
}
}
for (int i = 0; i < max_field; ++i) {
toggle_option("machine_max_jerk_x", enable_jerk, i);
toggle_option("machine_max_jerk_y", enable_jerk, i);
toggle_option("machine_max_jerk_z", enable_jerk, i);
toggle_option("machine_max_jerk_e", enable_jerk, i);
}
toggle_option("machine_max_jerk_x", enable_jerk, 0);
toggle_option("machine_max_jerk_y", enable_jerk, 0);
toggle_option("machine_max_jerk_z", enable_jerk, 0);
toggle_option("machine_max_jerk_e", enable_jerk, 0);
bool emittable_limits = gcf_is_marlin_legacy || gcf_is_marlin_firmware || gcf_is_reprap_firmware;
toggle_option("emit_machine_limits_to_gcode", emittable_limits);
@@ -7087,11 +7052,6 @@ void TabPrinter::update()
void TabPrinter::update_fff()
{
if (m_use_silent_mode != m_config->opt_bool("silent_mode")) {
m_rebuild_kinematics_page = true;
m_use_silent_mode = m_config->opt_bool("silent_mode");
}
// Sync IDEX/IQEX tool grid whenever carriage configuration changes.
// set_grid_size() is a no-op when dimensions and layout are unchanged.
// load_from_config() is gated on matches_config() — without that guard,
-2
View File
@@ -717,9 +717,7 @@ class IMEXModesCtrl;
class TabPrinter : public Tab
{
private:
bool m_use_silent_mode = false;
void append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string& label_path = "");
bool m_rebuild_kinematics_page = false;
void update_input_shaper_menu(GCodeFlavor flavor);
// R8: track the belt->non-belt transition so update_fff() only clears the belt-derived
-4
View File
@@ -1623,10 +1623,6 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
wxString label = option.label_local;
if (type == Preset::TYPE_PRINTER && variant_index >= 0 &&
printer_options_with_variant_2.count(get_pure_opt_key(opt_key)) > 0) {
// Orca: silent_mode is obsolete on import, but its option and two-column UI still exist.
// Keep mode labels for configs that explicitly enable it; omit them in the default single-mode UI.
if (new_config.opt_bool("silent_mode"))
label += " (" + (variant_index % 2 == 0 ? _L("Normal") : _L("Silent")) + ")";
variant_index /= 2;
}
if (variant_index >= 0 && extruder_variant && variant_index < extruder_variant->size()) {
+1
View File
@@ -68,6 +68,7 @@ add_executable(${_TEST_NAME}_tests
test_utils.cpp
test_miniz_extension.cpp
test_timeutils.cpp
test_semver.cpp
test_voronoi.cpp
test_wipe_tower_estimate.cpp
test_wipe_tower.cpp
+13
View File
@@ -1535,6 +1535,19 @@ TEST_CASE("handle_legacy migrates the adaptive TPMS keys", "[Config]") {
CHECK(ctxt.substitutions.empty());
}
TEST_CASE("silent_mode is no longer saved and is dropped on load", "[Config]") {
DynamicPrintConfig full;
full.apply(FullPrintConfig::defaults());
CHECK_FALSE(full.has("silent_mode"));
// Projects saved before its removal still carry it.
ConfigSubstitutionContext ctxt(ForwardCompatibilitySubstitutionRule::Enable);
DynamicPrintConfig config;
config.set_deserialize("silent_mode", "0", ctxt);
CHECK_FALSE(config.has("silent_mode"));
CHECK(ctxt.unrecogized_keys == std::vector<std::string>{"silent_mode"});
}
TEST_CASE("handle_legacy migrates every IDEX/IQEX key testers already have", "[Config]") {
// Three eras of saved profiles: the feature shipped as iXex (is_ixex + ixex_*), the clearance
// pair was renamed to say what it measures, then the whole prefix became imex_. Driven from the
+32
View File
@@ -0,0 +1,32 @@
#include <catch2/catch_message.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "libslic3r/Semver.hpp"
#include <string>
#include <tuple>
using namespace Slic3r;
TEST_CASE("A dev build ranks above its alpha and beta and below its release", "[Semver]") {
const auto [lower, higher] = GENERATE(table<std::string, std::string>({
{ "2.5.0-alpha", "2.5.0-dev" },
{ "2.5.0-beta", "2.5.0-dev" },
{ "2.5.0-rc", "2.5.0-dev" },
{ "2.5.0-alpha", "2.5.0-beta" },
{ "2.5.0-dev", "2.5.0" },
{ "2.4.2", "2.5.0-dev" },
{ "2.5.0", "2.6.0-dev" },
}));
INFO(lower << " < " << higher);
const Semver lo(lower);
const Semver hi(higher);
CHECK(lo < hi);
CHECK(hi > lo);
CHECK_FALSE(hi < lo);
}
TEST_CASE("Two dev builds of the same version are equal", "[Semver]") {
CHECK(Semver("2.5.0-dev") == Semver("2.5.0-dev"));
}