fix(factory-reset): parse the omnect-device-service result shape of feature version 4 - #126
Draft
JanZachmann wants to merge 1 commit into
Draft
fix(factory-reset): parse the omnect-device-service result shape of feature version 4#126JanZachmann wants to merge 1 commit into
JanZachmann wants to merge 1 commit 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adapts the factory-reset result wire types to the shape omnect-device-service publishes on
FactoryResetV1withfactory_resetfeature version 4 (omnect/omnect-device-service#207):statusis a u32 with the codessuccess,invalid,error,configErrorandwarningplus a catch-all,errorandcontextarrive asnullwhen nothing went wrong, and the newdata_wipedflag tells whether the destructive phase had already started. Raises the required omnect-device-service version to>=0.46.0.The domain status enum keeps two distinct non-result variants.
Unknownstays the default and means "no result received yet", which is what keeps the result modal silent.Unrecognizedis where the catch-all lands, so a status code a future omnect-device-service invents still reaches the user. Mapping the catch-all ontoUnknownwould have swallowed such a result instead.data_wipedis shown only on a non-success result. There it changes what the user has to do, because the device may sit in a half-wiped state and needs another reset to reach a defined one. On success it carries no action.warningcounts as success in the UI: the reset completed, a partition just needed a second format attempt.Reason
Closes #125. Once omnect/omnect-device-service#207 merges,
errorisnullon a successful reset while omnect-ui still requires aString, so every factory-reset result fails to deserialize and the UI shows a parse error instead of the result — including for a completely normal successful reset. The status codes were renamed and extended in the same change, so the oldrepr(u8)enum with four variants can no longer name what the device reports.This is a draft because the
>=0.46.0floor is not confirmed yet. omnect/omnect-device-service#207 is still open and its branch says0.44.2while omnect-device-service main is already at0.45.2, so the release that actually ships feature version 4 is not known. The constant carries aTODOmarker naming that condition; it has to be replaced with the real tag before merge.