Skip to content

Commit

Permalink
[Matter.framework] Do not delete the file containing the log data onc…
Browse files Browse the repository at this point in the history
…e the downloadLogOfType completion is done
  • Loading branch information
vivien-apple committed Feb 26, 2024
1 parent c33d262 commit 71c12d2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/darwin/Framework/CHIP/MTRBaseDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
/**
* Download log of the desired type from the device.
*
* Note: The consumer of this API should move the file that the url points to or open it for reading before the
* completion handler returns. Otherwise, the file will be deleted, and the data will be lost.
*
* @param type The type of log being requested. This should correspond to a value in the enum MTRDiagnosticLogType.
* @param timeout The timeout for getting the log. If the timeout expires, completion will be called with whatever
* has been retrieved by that point (which might be none or a partial log).
Expand Down
1 change: 0 additions & 1 deletion src/darwin/Framework/CHIP/MTRDiagnosticLogsDownloader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ - (instancetype)initWithType:(MTRDiagnosticLogType)type
// data in the logs that the caller may find useful. For this reason, fileURL is passed in even
// when there is an error but fileHandle is not nil.
completion(strongSelf->_fileHandle ? fileURL : nil, bdxError);
[strongSelf deleteFile];

done(strongSelf);
}
Expand Down

0 comments on commit 71c12d2

Please sign in to comment.