fix: ignore useCaseAvailable flag on client (EG) side#253
Open
andig wants to merge 1 commit into
Open
Conversation
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>
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.
Fixes #252 (TC_SPINE_RTC_003).
Problem
Per SPINE-TS-UCD-01, a client acting as Energy Guard must completely ignore the
useCaseAvailableflag received during Use Case discovery. The sharedUseCaseBaseevent handler (usecases/usecase/events.go) instead gated on it andcontinued past the use case support entry whenever the remote server sentuseCaseAvailable=false— so the client aborted setup and never initiated node management operations. Affects all use cases routed throughuseCaseDataUpdate()(LPC, LPP, ...) in the EG role.Fix
useCaseAvailablecheck from the guard condition.ScenarioSupport == nil && len(...) == 0toScenarioSupport == nil(len(nil) == 0always).Test
Updated
events_test.go: the EV support entry withuseCaseAvailable=falsenow asserts the use case registers instead of being dropped. Allusecases/...suites pass, includingeg/lpcandeg/lpp.🤖 Generated with Claude Code