Skip to content

Fix download flow not using new Bluetooth name after pattern change#795

Merged
microbit-matt-hillsdon merged 1 commit intoappsfrom
download-different
Mar 17, 2026
Merged

Fix download flow not using new Bluetooth name after pattern change#795
microbit-matt-hillsdon merged 1 commit intoappsfrom
download-different

Conversation

@microbit-matt-hillsdon
Copy link

@microbit-matt-hillsdon microbit-matt-hillsdon commented Mar 17, 2026

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.

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.
@github-actions
Copy link

Preview build will be at
https://review-createai.microbit.org/download-different/

Copy link

@microbit-grace microbit-grace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, LGTM

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 71cedee into apps Mar 17, 2026
4 checks passed
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the download-different branch March 17, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants