Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate if the Current Group = RemovedGroup before invalidating scene #28565

Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/app/clusters/scenes-server/scenes-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,18 @@ void ScenesServer::GroupWillBeRemoved(FabricIndex aFabricIx, EndpointId aEndpoin
SceneTable * sceneTable = scenes::GetSceneTableImpl(aEndpointId);
VerifyOrReturn(nullptr != sceneTable);

MakeSceneInvalid(aEndpointId);
chip::GroupId currentGroup;
Attributes::CurrentGroup::Get(aEndpointId, &currentGroup);

chip::SceneId currentScene;
Attributes::CurrentScene::Get(aEndpointId, &currentScene);
mpbreton marked this conversation as resolved.
Show resolved Hide resolved

// Validate if the Current Group = RemovedGroup before invalidating the scene.
mpbreton marked this conversation as resolved.
Show resolved Hide resolved
SceneTableEntry entry;
mpbreton marked this conversation as resolved.
Show resolved Hide resolved
if (aGroupId == currentGroup)
{
MakeSceneInvalid(aEndpointId);
}

VerifyOrReturn(nullptr != mGroupProvider);
if (0 != aGroupId && !mGroupProvider->HasEndpoint(aFabricIx, aGroupId, aEndpointId))
Expand Down