Publish frontend message when Auto Run changes, added integration test.#2754
Merged
DocMoebiuz merged 3 commits intomainfrom Feb 24, 2026
Merged
Publish frontend message when Auto Run changes, added integration test.#2754DocMoebiuz merged 3 commits intomainfrom
DocMoebiuz merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the AutoRun icon in the frontend toolbar didn't visually update when clicked. The issue was caused by the removal of a PropertyChanged event handler in PR #2711, which previously triggered settings updates to the frontend. The fix implements a cleaner approach by calling Properties.Settings.Default.Save() when the AutoRun value changes, which automatically triggers the SettingsSaving event handler that publishes settings to the frontend.
Changes:
- Removed redundant
setAutoRunValue()call fromMainForm_Shown()that was setting AutoRun to its own value - Added
Properties.Settings.Default.Save()call insetAutoRunValue()to trigger frontend settings update - Added integration test to verify AutoRun toggle publishes Settings message to frontend
- Enhanced test infrastructure with
SetSynchronizationContextProvider()to support synchronous message handling in tests
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| UI/MainForm.cs | Removed redundant AutoRun initialization and added Save() call to trigger frontend update |
| MobiFlightUnitTests/UI/MainFormTests.cs | Added integration test for AutoRun toggle and enhanced TestMessagePublisher with message simulation capability |
| MobiFlight/BrowserMessages/MessageExchange.cs | Added SetSynchronizationContextProvider() method for test support with documentation comment |
…el execution in CI
|
Build for this pull request: |
|
Build for this pull request: |
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.
Pull request overview
This PR fixes a bug where the AutoRun icon in the frontend toolbar didn't visually update when clicked. The issue was caused by the removal of a
PropertyChangedevent handler in PR #2711, which previously triggered settings updates to the frontend. The fix implements a cleaner approach by callingProperties.Settings.Default.Save()when the AutoRun value changes, which automatically triggers theSettingsSavingevent handler that publishes settings to the frontend.Changes:
setAutoRunValue()call fromMainForm_Shown()that was setting AutoRun to its own valueProperties.Settings.Default.Save()call insetAutoRunValue()to trigger frontend settings updateSetSynchronizationContextProvider()to support synchronous message handling in testsfixes #2753