Fix download flow not using new Bluetooth name after pattern change#795
Merged
microbit-matt-hillsdon merged 1 commit intoappsfrom Mar 17, 2026
Merged
Fix download flow not using new Bluetooth name after pattern change#795microbit-matt-hillsdon merged 1 commit intoappsfrom
microbit-matt-hillsdon merged 1 commit intoappsfrom
Conversation
syncConnectionSettings in the download flow read the micro:bit name from persisted settings, but since 97fc526 setMicrobitName only writes to download state (deferring persistence until connection succeeds). This meant changing the pattern via "My pattern is different" during FindingDevice left the old name filter on the Bluetooth connection, preventing it from finding the new micro:bit. Read from download state instead, matching the analogous fix already applied to the data connection flow in 97fc526. Adds an e2e test that changes the pattern mid-download and asserts the correct name filter is applied. There's a slightly odd behaviour whereby we write to settings the last micro:bit you successfully used (in either flow) but the connection flows keep their own state. I think this is OK if we don't / until we do support explicit same/different. I guess one option would be not to persist the name in the download flow unless no name was persisted at all.
|
Preview build will be at |
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.
syncConnectionSettings in the download flow read the micro:bit name from persisted settings, but since 97fc526 setMicrobitName only writes to download state (deferring persistence until connection succeeds). This meant changing the pattern via "My pattern is different" during FindingDevice left the old name filter on the Bluetooth connection, preventing it from finding the new micro:bit.
Read from download state instead, matching the analogous fix already applied to the data connection flow in 97fc526.
Adds an e2e test that changes the pattern mid-download and asserts the correct name filter is applied.
There's a slightly odd behaviour where we write to settings the last micro:bit you successfully used (in either flow) but the connection flows keep their own state. I think this is OK if we don't / until we do support explicit same/different. I guess one option would be not to persist the name in the download flow unless no name was persisted at all but I think it's unclear what the user would prefer without explicit same/different.