Skip to content

Adapt factory-reset result parsing to the new omnect-device-service result shape (feature version 4) #125

Description

@JanZachmann

omnect-device-service reports the factory-reset result in a new shape since omnect/omnect-device-service#207 (feature version factory_reset 3 -> 4). The current omnect-ui type cannot parse it.

New shape published on FactoryResetV1

{
  "keys": ["network", "firewall", "certificates"],
  "result": {
    "status": 0,
    "error": null,
    "context": null,
    "paths": ["network"],
    "data_wiped": true
  }
}
  • status is a u32: 0 success, 1 invalid request, 2 error, 3 configuration error, 4 warning (reset ok, but a partition needed a second format attempt). A code unknown to ODS is reported as 4294967295.
  • error and context are null unless the reset reported a problem.
  • paths lists the preserved paths.
  • data_wiped is new: true once the reset started wiping data; on status 2 it distinguishes a safe abort from a failure after data was already wiped.

Mismatches in omnect-ui (src/app/src/types/ods.rs)

ODS publishes omnect-ui expects
error null on success required String
status u32, 0..=4 or 4294967295 #[repr(u8)] enum with 0..=3 only
data_wiped always present not in the struct (ignored, ok)

Effect

Every factory-reset result fails to deserialize in parse_ods_update!; the UI shows a parse error instead of the result. This includes the normal successful reset.

Task

  • error, context: Option<String>
  • status: #[repr(u32)], add Warning = 4 and a #[serde(other)] catch-all
  • optionally show data_wiped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions