MobileNativeFoundation / Store

A Kotlin Multiplatform library for building network-resilient applications
https://mobilenativefoundation.github.io/Store/
Apache License 2.0
3.16k stars 197 forks source link

Inconsistent SourceOfTruth argument types #558

Closed elroid closed 1 year ago

elroid commented 1 year ago

I'm attempting to upgrade from version 5.0.0-alpha03 to 5.0.0-beta01 and I'm having trouble reconciling the changes that have been made as part of 5.0.0-alpha04. Specifically one of the builders in StoreBuilder (StoreBuilder.Companion#from(Fetcher<Key,Input>, SourceOfTruth<Key,Input>)) has been changed so that the source of truth takes a Key and an Input (Network) instead of Key and Local (Output) as before. I find this hard to reconcile with the SourceOfTruth class which remains unchanged and whose types remain Key and Local.

It looks like the tests all use the same type for Input and Output so perhaps this discrepancy fell through the cracks? As I understand it the source of truth only deals with local representations, not fetcher results. If I'm mistaken and this is indeed intentional, please advise how this is meant to work.

Also, it appears to me that this comment on another issue may be related.

digitalbuddha commented 1 year ago

Hello! apologies for this breaking change, I'm at a conference this week but will take a look over weekend/next week. I think this was an unintended breaking change

digitalbuddha commented 1 year ago

Fixed in #560