Repository navigation
Handle runtime auto-update interval changes and UI-thread OCR toasts - #131
Merged
dimitar-radenkov merged 3 commits intoJun 28, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves runtime correctness and test reliability by making auto-update scheduling responsive to live settings changes, and by ensuring OCR toast UI updates are marshaled safely to the WPF UI thread (including during shutdown).
Changes:
- Replace the long
PeriodicTimerwait with a settings-aware wait loop that re-readsAutoUpdateCheckIntervaland stops promptly when set toNever. - Update auto-update tests to deterministically verify the periodic loop terminates after switching the interval to
Never. - Marshal OCR toast show/hide work to the window dispatcher and add shutdown guards to avoid cross-thread/access-after-teardown crashes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Pointframe/Views/OverlayWindow.xaml.cs | Adds dispatcher marshalling and shutdown guards for OCR toast display/dismissal. |
| Pointframe/Services/Update/AutoUpdateService.cs | Reworks periodic scheduling to react to runtime interval changes via a poll-based wait loop. |
| Pointframe.Tests/Services/AutoUpdateServiceTests.cs | Replaces timing-dependent coverage with a deterministic “stop promptly after switching to Never” test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _messageBox = messageBox; | ||
| _logger = logger; | ||
| _telemetry = telemetry; | ||
| _settingsPollInterval = settingsPollInterval.GetValueOrDefault(DefaultSettingsPollInterval); |
Comment on lines
+493
to
+497
| if (!Dispatcher.CheckAccess()) | ||
| { | ||
| await Dispatcher.InvokeAsync(() => ShowOcrToast(message)); | ||
| return; | ||
| } |
| return; | ||
| } | ||
|
|
||
| await Dispatcher.InvokeAsync(() => OcrToast.Visibility = Visibility.Collapsed, DispatcherPriority.Normal); |
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.
Update notifications were only evaluated against the auto-update interval captured at service startup, so changing the interval to
Neverdid not stop the periodic loop until the original timer elapsed. The PR also addresses the cross-thread OCR toast dismissal path that could crash the WPF test host.Auto-update scheduling
PeriodicTimerwait with a settings-aware wait loop that re-readsAutoUpdateCheckIntervalwhile waiting.Never.Regression coverage
Never.WPF dispatcher safety