mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:05:18 +00:00
Remove message retention and /save command
- Delete MessageRetentionService.swift - Remove retentionEnabledChannels from ChatViewModel - Remove /save command handling - Remove retention UI elements from ContentView - Remove channelRetention message type from protocol - Update documentation and tests
This commit is contained in:
@@ -97,12 +97,10 @@ class KeychainIntegrationTests: XCTestCase {
|
||||
func testNoPlaintextInUserDefaults() {
|
||||
// Create services to generate keys
|
||||
_ = NoiseEncryptionService()
|
||||
_ = MessageRetentionService.shared
|
||||
|
||||
// Check UserDefaults for any sensitive data
|
||||
let keysToCheck = [
|
||||
"bitchat.noiseIdentityKey",
|
||||
"bitchat.messageRetentionKey",
|
||||
"bitchat.channelPasswords",
|
||||
"bitchat.identityKey",
|
||||
"bitchat.staticKey"
|
||||
|
||||
@@ -112,31 +112,7 @@ class NoiseIdentityPersistenceTests: XCTestCase {
|
||||
}
|
||||
|
||||
// MARK: - Message Retention Key Tests
|
||||
|
||||
func testMessageRetentionKeyPersistence() {
|
||||
// Create first instance
|
||||
_ = MessageRetentionService.shared
|
||||
|
||||
// Get key from keychain
|
||||
let keyData1 = KeychainManager.shared.getIdentityKey(forKey: "messageRetentionKey")
|
||||
XCTAssertNotNil(keyData1, "Message retention key should be stored")
|
||||
|
||||
// Simulate app restart by clearing the singleton
|
||||
// (In real app, this would be a new process)
|
||||
|
||||
// Get key again
|
||||
let keyData2 = KeychainManager.shared.getIdentityKey(forKey: "messageRetentionKey")
|
||||
XCTAssertEqual(keyData1, keyData2, "Message retention key should persist")
|
||||
}
|
||||
|
||||
func testMessageRetentionKeyNotInUserDefaults() {
|
||||
// Ensure service is initialized
|
||||
_ = MessageRetentionService.shared
|
||||
|
||||
// Verify key is NOT in UserDefaults
|
||||
let userDefaultsData = UserDefaults.standard.data(forKey: "bitchat.messageRetentionKey")
|
||||
XCTAssertNil(userDefaultsData, "Message retention key should NOT be in UserDefaults")
|
||||
}
|
||||
// Message retention feature has been removed
|
||||
|
||||
// MARK: - Keychain Service Name Tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user