Skip to content

fix(color): radio may crash when changing models#7385

Open
philmoz wants to merge 1 commit into
mainfrom
philmoz/fix-model-select
Open

fix(color): radio may crash when changing models#7385
philmoz wants to merge 1 commit into
mainfrom
philmoz/fix-model-select

Conversation

@philmoz
Copy link
Copy Markdown
Collaborator

@philmoz philmoz commented May 23, 2026

Prevent potential crash on model change.

Fixes #7382

2.12 & 3.0.

Summary by CodeRabbit

  • Bug Fixes
    • Improved model switching sequence to ensure proper cleanup and initialization of layouts during model transitions.

Review Change Stack

@philmoz philmoz added this to the 2.12.2 milestone May 23, 2026
@philmoz philmoz added bug 🪲 Something isn't working color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour labels May 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d4dd0a77-c450-4df7-9580-c843f8027b87

📥 Commits

Reviewing files that changed from the base of the PR and between 00d7544 and 09a5568.

📒 Files selected for processing (1)
  • radio/src/gui/colorlcd/model/model_select.cpp

📝 Walkthrough

Walkthrough

In ModelsPageBody::selectModel, the main view layout teardown is reordered to occur before model load and current model update. The layout is now deleted earlier in the transition sequence, preventing potential conflicts when switching to models with logging enabled.

Changes

Model Switching Sequence

Layer / File(s) Summary
Model switch operation ordering
radio/src/gui/colorlcd/model/model_select.cpp
LayoutFactory::deleteCustomScreens() is moved before loadModel(...) and modelslist.setCurrentModel(model) to ensure clean teardown of the previous model's layout before loading the new model.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main fix: preventing a crash when changing models, which aligns with the changeset modifying model selection logic.
Description check ✅ Passed The description includes a summary and references the fixed issue (#7382), matching the template requirements, though it could be more detailed.
Linked Issues check ✅ Passed The code reorders operations to delete the old layout before loading the new model, directly addressing issue #7382's crash during model switching when logging is involved.
Out of Scope Changes check ✅ Passed All changes are contained within the model selection flow and directly target the crash issue; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch philmoz/fix-model-select

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firmware 2.12.1 (and possibly previous) - Switch model, to a model with logging, causes Emergency Mode

1 participant