Skip to content

Failed to load settings, causing the device to not work #487

@Eloren1

Description

@Eloren1

Affected Version

0.15.0-dev

Describe the Bug

So I was developing some new features, let's say it's

enum POWER_BTN_HOLD_DURATION { PB_FAST = 0, PB_NORMAL = 1, PB_SLOW = 2, PB_XSLOW = 3 };

I had the PB_XSLOW selected, but then a few commits later I removed it and kept only:

enum POWER_BTN_HOLD_DURATION { PB_FAST = 0, PB_NORMAL = 1, PB_SLOW = 2 };

The device still tries to use = 3 and crashes when opening reader or settings.

Steps to Reproduce

  1. Device: Select any setting (i.e. Referesh Frequency - 30 pages)
  2. Dev: Remove this option (REFRESH_30) and run the update
  3. Device: Freezes while opening settings

I have a draft PR for this with removed REFRESH_30 option, if you flash it to the device it will stop opening settings. The only solution is to delete .crosspoint/settings.bin via PC.

#488

Expected Behavior

If some settings do not load, they should change to default variant. But it wasn't the case, because it still tried to get a non-existent value. It fails in SettingsActivity.cpp

This applies not only to development, but also for prod. If a user selects a enum value that has been removed in a future update, the entire device will stop working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageBug to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions