Use FilePath for content store client/server pair#28
Open
chrisgeo wants to merge 1 commit into
Open
Conversation
bff5801 to
116bcbf
Compare
Closes CHAOS-1455.
116bcbf to
a926e39
Compare
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.
Summary
ContentStoreService(server) andRemoteContentStoreClient(client) fromURLtoSystemPackage.FilePathacross the content-store XPC pair.ContentStoreService.init(root: URL, …)→init(root: FilePath, …)get(digest:) async throws -> URL?→FilePath?newIngestSession() async throws -> (id: String, ingestDir: URL)→(id: String, ingestDir: FilePath)ContentServiceHarnessnow serializes paths viaFilePath.string(replacingURL.path(percentEncoded: false)); the wire format onXPCMessageKey.contentPathand.directoryis unchanged (still a plain absolute path string), so client and server stay compatible.ContentStoreServiceupdated atSources/Plugins/CoreImages/ImagesHelper.swift:116— passesFilePath(root.path(percentEncoded: false))sinceappRootupstream is stillURL.RemoteContentStoreClient: private_get(digest:)is now FilePath-typed and decodes XPC strings viaFilePath(path)instead ofURL(filePath: path). The public protocol surface forContentStore(i.e.ingest(_ body: @Sendable @escaping (URL) async throws -> Void)andnewIngestSession() -> (id, URL)) is pinned by the upstreamContainerizationOCI.ContentStoreprotocol and staysURL— see boundary notes below.ContentStoreServiceis anactorwith non-serialized stored properties; XPC payloads remain plain path strings.URL boundaries preserved (with inline comments justifying each leak):
ContentStoreService.init→LocalContentStore(path: URL(filePath: self.root.string))— the upstreamContainerizationOCI.LocalContentStoreconstructor only acceptsURL.RemoteContentStoreClient.get(digest:)→LocalContent(path: URL(filePath: path.string))— the upstreamContainerizationOCI.LocalContentconstructor only acceptsURL.ContentStoreService.get(digest:)and.newIngestSession()convert URLs returned byLocalContentStoreback intoFilePathviaFilePath(url.path(percentEncoded: false))at the Containerization library boundary.RemoteContentStoreClient.newIngestSession()and.ingest(_:)keep theirURLsignatures unchanged because they are required by the externalContentStoreprotocol; changing them would break protocol conformance. Same precedent as PR Use FilePath for SnapshotStore #25'sdirectorySize/URLResourceKeyleak.Closes CHAOS-1455. Sibling of #26 (Bundle), part of CHAOS-1448 epic.
Type of Change
Testing