Skip to content

Add deviceBondState option to Bluetooth connection and remove speculative delays#87

Merged
microbit-grace merged 16 commits intoappsfrom
perf
Feb 9, 2026
Merged

Add deviceBondState option to Bluetooth connection and remove speculative delays#87
microbit-grace merged 16 commits intoappsfrom
perf

Conversation

@microbit-grace
Copy link
Contributor

@microbit-grace microbit-grace commented Feb 6, 2026

  • Add deviceBondState option to Bluetooth connect.
  • Set device as bonded when connection is established successfully.
  • Set device as not bonded when connection fails.
  • Remove speculative delays.
  • Ensure partial flashing errors are raised so that the app can handle them.

return result;
};

const partialFlashInternal = async (
Copy link
Contributor Author

@microbit-grace microbit-grace Feb 6, 2026

Choose a reason for hiding this comment

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

The diff to this function looks like a lot, but my intention was just to remove the try...catch... in favour of putting it outside of this function so that we can catch all the errors in partialFlash (including DisconnectError which can be thrown in the raceDisconnectAndTimeout used in partialFlash)

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying microbit-connection with  Cloudflare Pages  Cloudflare Pages

Latest commit: e271d4a
Status: ✅  Deploy successful!
Preview URL: https://0f38e9c6.microbit-connection.pages.dev
Branch Preview URL: https://perf.microbit-connection.pages.dev

View logs

@microbit-grace microbit-grace changed the title Track bonded iOS state to skip the bond-handling overhead and remove speculative delays Add isIosBonded option to Bluetooth connect and remove speculative delays Feb 6, 2026
@microbit-grace microbit-grace marked this pull request as ready for review February 6, 2026 15:47
@microbit-grace microbit-grace changed the title Add isIosBonded option to Bluetooth connect and remove speculative delays Add deviceBondState option to Bluetooth connection and remove speculative delays Feb 9, 2026
Copy link
Contributor

@microbit-matt-hillsdon microbit-matt-hillsdon left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@microbit-grace microbit-grace merged commit 39e4a26 into apps Feb 9, 2026
4 checks passed
@microbit-grace microbit-grace deleted the perf branch February 9, 2026 13:25
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