fix: project profile name shows stale value after editor save#10860
Open
BenJule wants to merge 3 commits into
Open
fix: project profile name shows stale value after editor save#10860BenJule wants to merge 3 commits into
BenJule wants to merge 3 commits into
Conversation
2 tasks
eec13d9 to
6fd0da8
Compare
The upstream build_all.yml only listed 'main' as a push trigger. BenJule/BambuStudio uses 'master' as its default branch, so CI never fired on fork-local pushes. Adding 'master' alongside 'main' makes the full multi-platform build run when master is updated.
After saving in the editor, clear_model_info() empties m_last_payload. If index.html loads and sends request_3mf_info before the background on_reload() thread completes — or if on_reload()'s RunScript call is dropped during webview navigation — the page receives no data and continues to display the pre-save profile name. Fall back to update_model_data() when request_3mf_info arrives with an empty m_last_payload. This triggers a fresh on_reload() which dispatches the up-to-date model data directly to the now-loaded page.
6fd0da8 to
1a0f653
Compare
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.
Summary
After saving in the Project editor and navigating back to the index page, the Profile Name displays the original (pre-edit) value instead of the newly saved one.
Root cause:
clear_model_info()emptiesm_last_payloadduring the save flow. Whenindex.htmlloads and immediately sendsrequest_3mf_info, C++ does nothing becausem_last_payloadis empty. The backgroundon_reload()thread that holds the fresh data fires itsRunScriptcallback while the webview is still navigating; the script is dropped and the page never receives the updated model data.Fix: When
request_3mf_infoarrives with an emptym_last_payload, callupdate_model_data()to trigger a fresh reload. The resultingon_reload()dispatches the current (post-save) model data directly to the now-fully-loaded page.Closes #10769
Changed file
src/slic3r/GUI/Project.cpp—OnScriptMessage/request_3mf_infohandlerTest plan