Files
purchases-ios/Sources/Logging/Strings/FileRepositoryStrings.swift
T
Jacob RakidzichandAntonio Pallares f033ddc398 Fix Crashes: Move large object cacheing off of user defaults to file storage (#5652)
* move device cache to file cache for potentially large data sets

* Fix vibe coded implementation and test it

* Update device cache tests

* bring back some of the old functionality

* revert accidental deletion

* use the static variable

* be kind and clean up after your(my)self.

* Move from caches to docs dir

* simplify cache by returning the decoded object

* remove update function and scope read and write to internal functions

* Potential fix for CI issues?

* fix tests

* Update Sources/Caching/DeviceCache.swift

Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>

* Update Sources/Caching/DeviceCache.swift

Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>

* scope adjustment

* requested changes

* fix test

---------

Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
2025-11-18 10:02:28 -06:00

44 lines
1.5 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// FileRepositoryStrings.swift
//
// Created by Jacob Zivan Rakidzich on 8/14/25.
import Foundation
enum FileRepositoryStrings {
case failedToSaveCachedFile(URL, Error)
case failedToFetchFileFromRemoteSource(URL, Error)
case failedToCreateCacheDirectory(URL)
case failedToCreateDocumentDirectory(URL)
case failedToCreateTemporaryFile(URL)
}
extension FileRepositoryStrings: LogMessage {
var description: String {
switch self {
case .failedToSaveCachedFile(let url, let error):
return "Failed to save file to \(url.absoluteString): \(error)"
case .failedToFetchFileFromRemoteSource(let url, let error):
return "Failed to download file from \(url.absoluteString): \(error)"
case .failedToCreateCacheDirectory(let url):
return "Failed to create cache directory for \(url.absoluteString)"
case .failedToCreateDocumentDirectory(let url):
return "Failed to create Document directory for \(url.absoluteString)"
case .failedToCreateTemporaryFile(let url):
return "Failed to create a temporary file for \(url.absoluteString)"
}
}
var category: String { return "file_repository" }
}