Skip to content

fix: ignore useCaseAvailable flag on client (EG) side#253

Open
andig wants to merge 1 commit into
enbility:devfrom
andig:fix/ignore-usecaseavailable-eg
Open

fix: ignore useCaseAvailable flag on client (EG) side#253
andig wants to merge 1 commit into
enbility:devfrom
andig:fix/ignore-usecaseavailable-eg

Conversation

@andig

@andig andig commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #252 (TC_SPINE_RTC_003).

Problem

Per SPINE-TS-UCD-01, a client acting as Energy Guard must completely ignore the useCaseAvailable flag received during Use Case discovery. The shared UseCaseBase event handler (usecases/usecase/events.go) instead gated on it and continued past the use case support entry whenever the remote server sent useCaseAvailable=false — so the client aborted setup and never initiated node management operations. Affects all use cases routed through useCaseDataUpdate() (LPC, LPP, ...) in the EG role.

Fix

  • Remove the useCaseAvailable check from the guard condition.
  • Simplify the redundant ScenarioSupport == nil && len(...) == 0 to ScenarioSupport == nil (len(nil) == 0 always).
  • Replace the stale comment referencing the old behavior.

Test

Updated events_test.go: the EV support entry with useCaseAvailable=false now asserts the use case registers instead of being dropped. All usecases/... suites pass, including eg/lpc and eg/lpp.

🤖 Generated with Claude Code

Per SPINE-TS-UCD-01 (TC_SPINE_RTC_003), a client acting as Energy Guard
must completely ignore the useCaseAvailable flag received during Use Case
discovery and proceed with setup, even when the remote server reports
useCaseAvailable=false.

The shared UseCaseBase event handler gated on this flag and skipped the
use case support entry when false, causing the client to abort use case
setup and never initiate node management operations.

Also simplify the redundant `ScenarioSupport == nil && len(...) == 0`
guard to the equivalent `ScenarioSupport == nil` (len(nil)==0 always).

Fixes enbility#252

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Client aborts use case setup when useCaseAvailable=false (TC_SPINE_RTC_003)

1 participant