fix: import BitFoundation so ComposerDraftStore sees PeerID

iOS target build failed without the module import that SPM resolved
transitively but Xcode did not. Also keep the eviction test inside the
test suite type.
This commit is contained in:
Taksh 2026-07-31 11:49:26 +03:00
parent c887c313cd
commit f9c8878d02
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,7 @@
//
import Foundation
import BitFoundation
/// Persists unfinished composer text per conversation so switching mesh /
/// geohash / DM channels does not silently discard what someone was typing.

View File

@ -61,12 +61,15 @@ struct ComposerDraftStoreTests {
#expect(ComposerDraftStore.load(.mesh, in: defaults).isEmpty)
#expect(defaults.object(forKey: ComposerDraftStore.storageKey) == nil)
}
}
@Test func maxDraftCountEvictsSurplusKeys() {
let defaults = makeDefaults()
for index in 0..<ComposerDraftStore.maxDraftCount {
ComposerDraftStore.save("d\(index)", for: .location(geohash: String(format: "gh%04d", index)), in: defaults)
ComposerDraftStore.save(
"d\(index)",
for: .location(geohash: String(format: "gh%04d", index)),
in: defaults
)
}
ComposerDraftStore.save("newest", for: .mesh, in: defaults)
let map = defaults.dictionary(forKey: ComposerDraftStore.storageKey) as? [String: String] ?? [:]