Skip to content

Commit 88d8e88

Browse files
Sync csa branch with main (#256)
2 parents d535811 + 34ba6ec commit 88d8e88

File tree

8 files changed

+918
-942
lines changed

8 files changed

+918
-942
lines changed

.devcontainer/devcontainer.json

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
{
22
"name": "CHIP Ubuntu Development Environment",
33
"runArgs": [
4-
"--cap-add=SYS_PTRACE",
5-
"--security-opt",
6-
"seccomp=unconfined",
74
"--network=host",
8-
"--privileged",
9-
"-v",
10-
"/dev/bus/usb:/dev/bus/usb:ro",
115
"--device-cgroup-rule=a 189:* rmw",
126
"--add-host=host.docker.internal:host-gateway"
137
],
8+
"privileged": true,
9+
"capAdd": ["SYS_PTRACE"],
10+
"securityOpt": ["seccomp=unconfined"],
1411
"mounts": [
15-
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
12+
{
13+
"source": "/var/run/docker.sock",
14+
"target": "/var/run/docker.sock",
15+
"type": "bind"
16+
},
17+
{
18+
"source": "/dev/bus/usb",
19+
"target": "/dev/bus/usb",
20+
"type": "bind"
21+
}
1622
],
17-
"initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 74",
23+
"initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 97",
1824
"image": "matter-dev-environment:local",
1925
"remoteUser": "vscode",
2026
"containerEnv": {

.github/workflows/restyled.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616

1717
- uses: restyled-io/actions/setup@v4
1818
with:
19-
# Pin the Restyler version to v0.6.0.2
19+
# TODO: Pinned to v0.6.0.2 because the latest release does not have a pre-built
20+
# 'restyler-linux' asset. This broke our workflow as we rely on the pre-built binary.
21+
# Remove this pin once a new release with the 'restyler-linux' asset is available.
2022
tag: 'v0.6.0.2'
2123

2224
- id: restyler

src/app/InteractionModelEngine.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -1967,12 +1967,20 @@ void InteractionModelEngine::OnFabricRemoved(const FabricTable & fabricTable, Fa
19671967
});
19681968

19691969
#if CHIP_CONFIG_ENABLE_READ_CLIENT
1970-
for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient())
1970+
for (auto * readClient = mpActiveReadClientList; readClient != nullptr;)
19711971
{
1972+
// ReadClient::Close may delete the read client so that readClient->GetNextClient() will be use-after-free.
1973+
// We need save readClient as nextReadClient before closing.
19721974
if (readClient->GetFabricIndex() == fabricIndex)
19731975
{
19741976
ChipLogProgress(InteractionModel, "Fabric removed, deleting obsolete read client with FabricIndex: %u", fabricIndex);
1977+
auto * nextReadClient = readClient->GetNextClient();
19751978
readClient->Close(CHIP_ERROR_IM_FABRIC_DELETED, false);
1979+
readClient = nextReadClient;
1980+
}
1981+
else
1982+
{
1983+
readClient = readClient->GetNextClient();
19761984
}
19771985
}
19781986
#endif // CHIP_CONFIG_ENABLE_READ_CLIENT

src/app/InteractionModelEngine.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler,
324324
/**
325325
* @brief Function decrements the number of subscriptions to resume counter - mNumOfSubscriptionsToResume.
326326
* This should be called after we have completed a re-subscribe attempt on a persisted subscription wether the attempt
327-
* was succesful or not.
327+
* was successful or not.
328328
*/
329329
void DecrementNumSubscriptionsToResume();
330330
#endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
@@ -714,7 +714,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler,
714714
#endif // CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
715715
#endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
716716

717-
FabricTable * mpFabricTable;
717+
FabricTable * mpFabricTable = nullptr;
718718

719719
CASESessionManager * mpCASESessionMgr = nullptr;
720720

src/controller/tests/data_model/TestRead.cpp

+879-920
Large diffs are not rendered by default.

src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))
3838
//- (oneway void)controller:(NSUUID *)controller commissioningComplete:(NSError * _Nullable)error nodeID:(NSNumber * _Nullable)nodeID metrics:(MTRMetrics * _Nullable)metrics;
3939
//- (oneway void)controller:(NSUUID *)controller readCommissioningInfo:(MTRProductIdentity *)info;
4040
@optional
41-
- (oneway void)controller:(NSUUID *)controller controllerConfigurationUpdated:(NSDictionary *)configuration;
41+
- (oneway void)controller:(NSUUID *)controller controllerConfigurationUpdated:(NSDictionary *)configuration MTR_AVAILABLE(ios(18.3), macos(15.3), watchos(11.3), tvos(18.3));
4242
@end
4343

4444
MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))

src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))
5454

5555
@end
5656

57-
MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))
57+
MTR_AVAILABLE(ios(18.3), macos(15.3), watchos(11.3), tvos(18.3))
5858
@protocol MTRXPCServerProtocol_MTRDeviceController <NSObject>
5959

6060
@optional
@@ -75,11 +75,11 @@ MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))
7575

7676
- (oneway void)deviceController:(NSUUID *)controller registerNodeID:(NSNumber *)nodeID;
7777
- (oneway void)deviceController:(NSUUID *)controller unregisterNodeID:(NSNumber *)nodeID;
78-
- (oneway void)deviceController:(NSUUID *)controller updateControllerConfiguration:(NSDictionary *)controllerState;
78+
- (oneway void)deviceController:(NSUUID *)controller updateControllerConfiguration:(NSDictionary *)controllerState MTR_AVAILABLE(ios(18.3), macos(15.3), watchos(11.3), tvos(18.3));
7979

8080
@end
8181

82-
MTR_AVAILABLE(ios(18.2), macos(15.2), watchos(11.2), tvos(18.2))
82+
MTR_AVAILABLE(ios(18.3), macos(15.3), watchos(11.3), tvos(18.3))
8383
@protocol MTRXPCServerProtocol <NSObject, MTRXPCServerProtocol_MTRDevice, MTRXPCServerProtocol_MTRDeviceController>
8484
@optional
8585
- (oneway void)deviceController:(NSUUID *)controller checkInWithContext:(NSDictionary *)context;

src/darwin/Framework/CHIPTests/MTRPairingTests.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,15 @@ - (void)test007_pairingAfterCancellation_FindOperational
480480
- (void)test008_pairingAfterCancellation_DeviceAttestationVerification
481481
{
482482
// Cancel pairing while we are waiting for our client to decide what to do
483-
// with the attestation information we got.
484-
__block BOOL delegateCalled = NO;
485-
__auto_type * attestationDelegate = [[NoOpAttestationDelegate alloc] initWithCallback:^{
486-
delegateCalled = YES;
487-
} blockCommissioning:YES];
483+
// with the attestation information we got. Note that the delegate is
484+
// called on some arbitrary queue, so we need to make sure we wait for it to
485+
// actually be called; we can't just have it set a boolean that we then
486+
// check, because that can race.
487+
XCTestExpectation * expectation = [self expectationWithDescription:@"Attestation delegate called"];
488+
__auto_type * attestationDelegate = [[NoOpAttestationDelegate alloc] initWithExpectation:expectation blockCommissioning:YES];
488489

489490
[self doPairingTestAfterCancellationAtProgress:@"Successfully extended fail-safe timer to handle DA failure" attestationDelegate:attestationDelegate];
490-
XCTAssertTrue(delegateCalled);
491+
[self waitForExpectations:@[ expectation ] timeout:kPairingTimeoutInSeconds];
491492
}
492493

493494
- (void)test009_PairWithReadingEndpointInformation

0 commit comments

Comments
 (0)