GoodPersistence icon indicating copy to clipboard operation
GoodPersistence copied to clipboard

Recording persistence error in Crashlytics

Open vaIerika opened this issue 1 year ago • 3 comments

@andrej-jasso @sebastianmraz Did you consider to add functionality to handle errors?

https://github.com/GoodRequest/GoodPersistence/blob/795727bb383b92645b7e18b4624adee36a19143e/Sources/GoodPersistence/UserDefaultsWrapper.swift#L49

vaIerika avatar Mar 20 '24 11:03 vaIerika

When does this issue happen. Is this a migration issue?

andrej-jasso avatar Mar 21 '24 13:03 andrej-jasso

Yes, it could happen during migration, as well as local changing models in some way (remaining parameters or changing type during refactor) without realizing that the object is already cached for some users. It will be really hard to trace that error without logging the error.

Also Dominik mentioned that we added Logger here because of SLA bug and it helped to identify the problem caused by the codable inside the property.

vaIerika avatar Mar 22 '24 08:03 vaIerika

So what we could add is a completion for error handling. Would it be an adequate solution for Notino to add errors in the publisher ? Like in the keychain publisher<Value, Error> also for userdefaults Do we also need a property wrapper parameter with a function time for the completion <Result> ?

andrej-jasso avatar Mar 22 '24 11:03 andrej-jasso