💾 GoodPersistence is an iOS library that simplifies caching data in keychain and UserDefaults. Using a property wrapper, it reduces the complexity of implementing caching mechanisms, making it easier for developers to focus on app functionality. Compatible with latest Swift and supports all iOS devices. Easy to install with SPM.
Describe the bug
In case we are subscribed to valuePublisher, after first error passed to subject, subject completes and is not reinitialized. After error we are unable to receive new values passed to keychain.
To Reproduce
Steps to reproduce the behavior:
Create Keychain
Subscribe to valuePublisher
Try to force error inside keychain property
Pass valid value to property
New value is not receiver in valuePublisher
Expected behavior
After receiving error, I am able to receive next values.
Additional context
Suggested solution:
private let newSubject: PassthroughSubject<Either<T, KeychainError>, Never> = PassthroughSubject()
private let newSubject: PassthroughSubject<Event<T, KeychainError>, Never> = PassthroughSubject()
We removed error emitting and allowed just value emitting. Also methods to retrieve and save data throw errors which are logged and you can connect on the logger now
Describe the bug In case we are subscribed to valuePublisher, after first error passed to subject, subject completes and is not reinitialized. After error we are unable to receive new values passed to keychain.
To Reproduce Steps to reproduce the behavior:
Expected behavior After receiving error, I am able to receive next values.
Additional context Suggested solution: