fix(filament-manager): don't write a preset setting_id into a spool's filament id - #12079
Open
marciogranzotto wants to merge 1 commit into
Open
Conversation
… filament id
A spool's `setting_id` field must hold a *filament_id* — that is the only
thing it is ever matched against:
// PresetBundle::get_filament_by_filament_id
if (filament_preset.filament_id == filament_id) { ... }
// AMSMaterialsSetting.cpp
bundle->get_filament_by_filament_id(sp->setting_id).has_value()
AddEditDialog resolved that value as
matchedCloudFilamentId
|| matchedPresetItem?.setting_id
|| matchedPresetItem?.filament_id
|| initSpool?.setting_id
`matchedCloudFilamentId` only resolves against the global cloud catalogue, so
for a custom filament (a vendor not in that catalogue) it is empty and the
chain falls through to the preset's `setting_id`. Preset setting ids are
`PFUS` + 14 hex while filament ids are `P` + 7 hex / `GFxxx`, so the stored
value can never equal any preset's `filament_id` and the spool is shown under
"Unsupported Filaments" permanently. Re-picking the filament in the dialog
re-runs the same fallback and does not help.
Drop the wrong-namespace term at both resolution sites. In the `preset/list`
payload every item carries both ids, so `matchedPresetItem?.setting_id` never
acted as a useful fallback — whenever it was set, `filament_id` was set too —
it only shadowed the correct value.
BambulabRobot
requested review from
JingyuSunBambu
and removed request for
XinZhangBambu
August 31, 2026 08:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #11937 (also reported in #11562, #11654, #11871). My duplicate issue #12078 is closed.
Problem
A spool's
setting_idfield must hold a filament_id — that is the only thing it is ever matched against:AddEditDialogresolved that value as:matchedCloudFilamentIdonly resolves on an exact match against the global cloud catalogue:A user's own custom filament is never in that catalogue, so the first term is empty and the chain falls through to the preset's
setting_id. Preset setting ids arePFUS+ 14 hex while filament ids areP+ 7 hex (orGFxxx), so the stored value can never equal any preset'sfilament_id— the spool is shown under Unsupported Filaments permanently. Re-picking the filament in the dialog re-runs the same fallback and does not help.On my install this affected 13 of 35 spools. Every broken spool held a
PFUS…value that was thesetting_idof the very preset it should have pointed at. The same filament appeared in both states (PLA Velvet OK on 6 spools / broken on 7), confirming it is per-spool write data rather than a preset problem — the healthy ones were created earlier via a path that resolved the realfilament_id.Change
Drop the wrong-namespace term at both resolution sites (
handleSubmitand thefilaIdmemo that mirrors it), and correct the comment that documented the old order.Why this is safe
In the
preset/listpayload, all 325 preset items carry bothfilament_idandsetting_id— zero items havesetting_idwithoutfilament_id. SomatchedPresetItem?.setting_idcould never act as a useful fallback: whenever it was set,filament_idwas set too. It could only shadow the correct value.That said, this is one machine's profile set — please confirm there is no profile source where an item legitimately has a
setting_idbut nofilament_id. If such a case exists, ordering the term last rather than removing it would be the safer variant.Note this fixes newly created spools only; records already written with a
PFUS…id need theirsetting_idrewritten to the matchingfilament_id.Difference from #12060
#12060 orders the term last (
cloud filamentId > preset filament_id > preset setting_id);this PR removes it. Both fix the reported bug — ordering it last is the more conservative
choice and is fine. The note above about all 325 preset items carrying both ids is the
argument for removal, not a requirement.
This PR also fixes newly created spools only; it does not migrate records already written
with a
PFUS…id. #12060 does, which is a further reason to prefer it.🤖 Generated with Claude Code