Repository navigation
feat: factory reset feature version 4, wcs service-info probe, drop reset mode 4 - #132
JanZachmann wants to merge 9 commits into
Conversation
…eature version 4 Adapt the factory-reset result wire types to the shape omnect-device-service publishes on FactoryResetV1 with factory_reset feature version 4: - status is a u32 with the codes success, invalid, error, configError and warning, plus a catch-all so a future code parses instead of failing the whole update - error and context arrive as null when nothing went wrong - data_wiped tells whether the destructive phase had already started Raise the required omnect-device-service version to 0.46.0. Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
Use the service-info endpoint as the single availability probe. It returns version, interface name and live BLE state in one call, replacing the separate status and version requests. Report the version requirement the same way as for omnect-device-service: a semver requirement string plus a required/current/mismatch triple. Unlike the device service a stale wifi-commissioning-service does not block the UI, since WiFi is optional and gated on the socket being present — the mismatch shows in the WiFi section of the device info. Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
service-info reports the version, so the separate version request has no caller left. Also correct the version floor comment: 0.2.0 already serves service-info, the floor tracks the released tag. Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com
Mode 4 ran a customer-supplied wipe hook in the initramfs. The hook is gone and the initramfs no longer accepts the mode: a trigger carrying it fails to parse, the device boots normally and no result is reported at all, so a reset requested with it would never be answered. The web API rejects the value now, instead of passing it on. Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Fixes RUSTSEC-2026-0385, RUSTSEC-2026-0382 and RUSTSEC-2026-0383. Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Move the wcs availability decision into a pure function with a test per branch and share one version check with the ods client. The result dialog names an unknown status, shows a warning's context, and no longer says a new reset fixes a failure after data was changed. Test status codes the UI does not know, reject mode 4, and cut comments and tests that add nothing. Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
JoergZeidler
left a comment
There was a problem hiding this comment.
Review of the three changes. All contracts are followed across core, generated types and the Vue shell; no correctness bugs. cargo +nightly fmt and cargo test --features mock pass locally. clippy could not run clean here because of a pre-existing unknown lint: clippy::unused_async_trait_impl in api.rs/certificate.rs (outside this PR) with no toolchain pinned — not a PR issue. tsc/biome/e2e were not run (no bun in my environment).
Inline comments hold the per-file findings. Two more that have no diff line to anchor to:
- Low —
project-context.mdnot updated. The new backend modulesrc/backend/src/version.rsis not in the "Project Structure" tree. The file's own rule asks for that section to be updated on a structure change. - Minor —
README.md:187wording. It says the WiFi entry shows the "minimum required version"; the UI now showscurrent (required: >=X). Small wording drift, not a contract break.
Unverified (no action needed, just noting): the three RUSTSEC advisory IDs in the dep-bump commit are not checked (no cargo-audit config / no network), and the external service payloads (factory_reset v4, /api/v1/service-info) are checked against this repo's client and tests plus the named producer PRs, not the other repos' source.
…hecks wifi-commissioning-service always sends status "ok" on HTTP 200 for service-info; a failure is a non-2xx answer, which is already reported as unavailable. The field is not needed. Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
JoergZeidler
left a comment
There was a problem hiding this comment.
All round-1 findings resolved in 718ecf6. Verified locally: cargo +nightly fmt --check and cargo test --features mock pass. Dropping the unused status field is serde-safe (no deny_unknown_fields), and the two e2e negative assertions are correct. clippy/tsc/biome/e2e not re-run in my environment; trusting your reported runs.
Closes #125
Summary
omnect-os moves from the scripted initramfs to omnect-os-init, an init written in Rust (omnect/meta-omnect#697). The new init writes a different factory-reset result and does not support reset mode 4; omnect/omnect-device-service#207 publishes this result as
factory_resetfeature version 4. This PR makes omnect-ui follow both changes. It also changes the probe of wifi-commissioning-service.Factory reset result of feature version 4
statusis au32with the codessuccess,invalid,error,configErrorandwarningplus a catch-all,errorandcontextarenullwhen nothing went wrong, and the newdata_wipedflag tells whether the reset had already started to change data. The required omnect-device-service version is>=0.46.1.Unknownis the default and means "no result received yet", so the result dialog stays hidden.Unrecognizedis the catch-all, so a status code that a later omnect-device-service adds still reaches the user.warningcounts as success in the UI: the reset completed, but a partition needed a second format attempt.data_wipedis shown only on a failed result, where the device may be partly wiped and needs another reset.wifi-commissioning-service probe via service-info
GET /api/v1/service-info(wifi-commissioning-service 0.2.0, feat(api): add /api/v1/service-info exposing ble_enabled wifi-commissioning-service#3) is the only availability probe: it returns version, interface name and BLE state in one call. The probe no longer calls/api/v1/statusand/api/v1/version.>=0.2.1) and the existingVersionInfo { required, current, mismatch }.WifiAvailability::Unavailablecarriesversion_info: Option<VersionInfo>.Nonemeans the probe failed or the version does not parse; the device info showsunknown. An empty interface name also makes the service unavailable.ble_enabledis only logged.Factory reset mode 4 removed
Reason
With omnect/omnect-device-service#207,
errorisnullafter a successful reset, but omnect-ui requires aString. So every factory-reset result fails to deserialize, and the UI shows a parse error instead of the result. The status codes were renamed and extended in the same change, so the oldrepr(u8)enum with four variants cannot name what the device reports.The service-info probe needs one request instead of two. With the same requirement string and
VersionInfoas omnect-device-service, both services report an unsupported version in the same way. The required version>=0.2.1is the released wifi-commissioning-service tag.Mode 4 ran a customer wipe script inside the scripted initramfs. omnect-os-init has no such script and answers mode 4 with
Invalid, a reset that never runs. Rejecting the value here keeps the request from being sent at all.This PR, omnect/omnect-device-service#207 and omnect/meta-omnect#697 have to reach a release together, so no component offers a mode the device refuses, and the UI can read the result the device reports.