diff --git a/Sources/XMTPiOS/Client.swift b/Sources/XMTPiOS/Client.swift index 004a0b82..65f99dfb 100644 --- a/Sources/XMTPiOS/Client.swift +++ b/Sources/XMTPiOS/Client.swift @@ -64,8 +64,7 @@ public struct ClientOptions { preEnableIdentityCallback: PreEventCallback? = nil, preCreateIdentityCallback: PreEventCallback? = nil, mlsAlpha: Bool = false, - mlsEncryptionKey: Data? = nil, - mlsDbDirectory: String? = nil + mlsEncryptionKey: Data? = nil ) { self.api = api self.codecs = codecs @@ -73,7 +72,6 @@ public struct ClientOptions { self.preCreateIdentityCallback = preCreateIdentityCallback self.mlsAlpha = mlsAlpha self.mlsEncryptionKey = mlsEncryptionKey - self.mlsDbDirectory = mlsDbDirectory } } @@ -148,13 +146,7 @@ public final class Client { } let alias = "xmtp-\(options?.api.env.rawValue ?? "")-\(inboxId ?? address).db3" - let dbURL: String - if let mlsDbDirectory = options?.mlsDbDirectory { - let mlsDbDirectoryURL = URL(fileURLWithPath: mlsDbDirectory) - dbURL = mlsDbDirectoryURL.appendingPathComponent(alias).path - } else { - dbURL = URL.documentsDirectory.appendingPathComponent(alias).path - } + let dbURL = URL.documentsDirectory.appendingPathComponent(alias).path let encryptionKey = options?.mlsEncryptionKey diff --git a/Tests/XMTPTests/ClientTests.swift b/Tests/XMTPTests/ClientTests.swift index 71ba11ea..908b250d 100644 --- a/Tests/XMTPTests/ClientTests.swift +++ b/Tests/XMTPTests/ClientTests.swift @@ -93,66 +93,6 @@ class ClientTests: XCTestCase { } } - func testPassingMLSEncryptionKeyAndDatabasePath() async throws { - let bo = try PrivateKey.generate() - let key = try Crypto.secureRandomBytes(count: 32) - let documentsURL = try - FileManager.default.url( - for: .documentDirectory, - in: .userDomainMask, - appropriateFor: nil, - create: false - ) - - let client = try await Client.create( - account: bo, - options: .init( - api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key, - mlsDbDirectory: "xmtp_db" - ) - ) - - let keys = client.privateKeyBundle - let bundleClient = try await Client.from( - bundle: keys, - options: .init( - api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key, - mlsDbDirectory: "xmtp_db" - ) - ) - - XCTAssertEqual(client.address, bundleClient.address) - XCTAssert(!client.installationID.isEmpty) - - await assertThrowsAsyncError( - _ = try await Client.from( - bundle: keys, - options: .init( - api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: nil, - mlsDbDirectory: "xmtp_db" - ) - ) - ) - - await assertThrowsAsyncError( - _ = try await Client.from( - bundle: keys, - options: .init( - api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key, - mlsDbDirectory: nil - ) - ) - ) - } - func testCanDeleteDatabase() async throws { let bo = try PrivateKey.generate() let alix = try PrivateKey.generate()