Skip to content

Adding eraseAppSettings to UpgradeOptions TypeScript type #545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BMR11
Copy link

@BMR11 BMR11 commented Jul 4, 2025

Allowing TypeScript to pass eraseAppSettings as part of UpgradeOptions, so that we can have more control if we want to erase app settings or not

Currently, there is no way of erasing App settings as part of the MCU manager firmware update.
This is because this is handled by a boolean eraseAppSettings and its set to false.
By allowing it to pass it via UpgradeOptions, we can have more control

Self Review:

  • Appropriate test coverage
  • Relevant Documentation updated

Smoke Tests:

  • ...

@@ -114,6 +114,7 @@ class DeviceUpgrade {
self.dfuManager = FirmwareUpgradeManager(transport: self.bleTransport!, delegate: self)
let config = FirmwareUpgradeConfiguration(
estimatedSwapTime: self.options.estimatedSwapTime,
eraseAppSettings: self.options.eraseAppSettings,
Copy link
Author

Choose a reason for hiding this comment

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

This will pass ts argument to the iOS FirmwareUpgradeConfiguration constructor

@@ -4,4 +4,5 @@ struct UpdateOptions: Record {
@Field var estimatedSwapTime: TimeInterval = 0
@Field var upgradeFileType: Int = 0
@Field var upgradeMode: Int?
@Field var eraseAppSettings: Bool = false
Copy link
Author

Choose a reason for hiding this comment

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

We not passed, it will be false

Copy link
Contributor

@ball-hayden ball-hayden left a comment

Choose a reason for hiding this comment

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

Thank you for the PR.

Please could you smoke test (manually test) this using the example app on Android and iOS, checking that settings are preserved when the option is false, and settings are erased when the option is true?

@@ -28,6 +28,7 @@ class UpdateOptions : Record {
@Field val estimatedSwapTime: Int = 0
@Field val upgradeFileType: Int = 0
@Field val upgradeMode: Int? = null
@Field val eraseAppSettings: Boolean? = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Please can you make sure this is passed through into FirmwareUpgradeManager?

@BMR11
Copy link
Author

BMR11 commented Jul 9, 2025

Thank you for the PR.

Please could you smoke test (manually test) this using the example app on Android and iOS, checking that settings are preserved when the option is false, and settings are erased when the option is true?

Sure, will do it and update the PR details with the results.
Thank you

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