Skip to content

fix(core): DIAGNOSTICS_FAILURE carries a dead status set and non-1.6 vocabulary #184

Description

@sepehr-safari

detectDiagnosticsFailure gates on the same status twice, and the outer gate is
misleading.

DIAGNOSTICS_FAILURE_STATUSES (detection.ts:754) lists five values:

const DIAGNOSTICS_FAILURE_STATUSES = new Set([
  'Idle', 'Uploaded', 'UploadFailed', 'DiagnosisFailed', 'NotImplemented',
]);

but the body then narrows again:

if (status === 'UploadFailed' || status === 'DiagnosisFailed') {

So Idle, Uploaded and NotImplemented sit in a set named "failure statuses"
and can never produce a failure. Confirmed by probing the rule directly: Idle,
Uploading, Uploaded and NotImplemented all report nothing, and only
UploadFailed and DiagnosisFailed fire. The behaviour is correct; the code
says something different from what it does.

Two things worth settling at the same time, both the same family as #154:

If DiagnosisFailed turns out not to be a 1.6 value, note that
diagnostics-failure.ts uses exactly that status, so the corpus would be
exercising a value no conformant 1.6 station sends. That is the same problem #154
found and fixed for InstallFailed.

No behaviour change is required to remove the dead gate; the vocabulary question
may change behaviour and is worth deciding deliberately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package:core@ocpp-debugkit/corepriority:mediumShould be done in current milestonetype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions