fix: run flash operations on background thread to avoid UI message pump dependency#501
Open
akash1306 wants to merge 2 commits intoqmk:masterfrom
Open
fix: run flash operations on background thread to avoid UI message pump dependency#501akash1306 wants to merge 2 commits intoqmk:masterfrom
akash1306 wants to merge 2 commits intoqmk:masterfrom
Conversation
…mp dependency Flash/reset/EEPROM operations used async/await without ConfigureAwait(false), causing continuations between sequential process calls to be posted back to the UI thread via WindowsFormsSynchronizationContext. When the window received no input events, the message loop would not wake to process these continuations, stalling firmware updates for hours until a stray WM_MOUSEMOVE arrived. Wrap bootloader operation loops in Task.Run() so continuations execute on threadpool threads with no dependency on the Windows message pump.
Author
|
For context, I found the issue when my firmware update took hours, and turns out the toolbox was waiting for windows events. So the update moved, for example, when I moved my mouse. |
tzarc
previously approved these changes
Apr 1, 2026
Author
|
I'll check the error tomorrow |
Author
|
Corrected the error. It was a missing import. My bad. It's building on my machine now. |
tzarc
approved these changes
Apr 2, 2026
Author
|
I was testing it this morning and the bug is still there. I needed to move my mouse to make the update move. I have to go to the office now so I'll check it in the evening. I'll confirm when I have tested it again. Sorry for the troubles. |
Member
|
Maybe give this a try: https://github.com/tzarc/qmk_toolbox/releases/tag/beta-xplat |
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.
Flash/reset/EEPROM operations used async/await without ConfigureAwait(false), causing continuations between sequential process calls to be posted back to the UI thread via WindowsFormsSynchronizationContext. When the window received no input events, the message loop would not wake to process these continuations, stalling firmware updates for hours until a stray WM_MOUSEMOVE arrived.
Wrap bootloader operation loops in Task.Run() so continuations execute on threadpool threads with no dependency on the Windows message pump.