GoodPersistence icon indicating copy to clipboard operation
GoodPersistence copied to clipboard

Using valuePublisher completes on first error

Open DominikPetho opened this issue 1 year ago • 0 comments

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:

  1. Create Keychain
  2. Subscribe to valuePublisher
  3. Try to force error inside keychain property
  4. Pass valid value to property
  5. New value is not receiver in valuePublisher

Expected behavior After receiving error, I am able to receive next values.

Additional context Suggested solution:

  1. private let newSubject: PassthroughSubject<Either<T, KeychainError>, Never> = PassthroughSubject()
  2. private let newSubject: PassthroughSubject<Event<T, KeychainError>, Never> = PassthroughSubject()

DominikPetho avatar Apr 05 '24 09:04 DominikPetho