Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix breaking changes with source of truth #559

Closed
digitalbuddha opened this issue Jun 10, 2023 · 7 comments · Fixed by #560
Closed

[BUG] Fix breaking changes with source of truth #559

digitalbuddha opened this issue Jun 10, 2023 · 7 comments · Fixed by #560
Assignees
Labels
bug Something isn't working

Comments

@digitalbuddha
Copy link
Contributor

Store 4 had a source of truth that can write one type and read another. During some work adding mutable store, we broke that contract. I'll be adding the functionality back, it was an unintentional oversight

@digitalbuddha digitalbuddha added the bug Something isn't working label Jun 10, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Triage in Store Roadmap Jun 10, 2023
@digitalbuddha digitalbuddha self-assigned this Jun 10, 2023
@digitalbuddha
Copy link
Contributor Author

Starting looking at it. This work should be completed by end of week. The goals are to push ant converter and local data type logic down to multable store apis leaving non mutable stores as binary compatibile with old

@digitalbuddha
Copy link
Contributor Author

digitalbuddha commented Jun 12, 2023

This is what I was thinking...cc @matt-ramotar

Operation Store MutableStore
Write network network OR output
Read output output

Need a way to convert output back to network or have a common type for writing

With a common type called Local and a converter construct
interface Converter<Network : Any, Output : Any, Local : Any>

Operation Store MutableStore
Write network.toLocal network.toLocal OR output.toLocal
Read output output

Effectively store will have a dummy converter that has same type for network and local for example
DummyConverter<Network, Output>(): Converter<Network, Output, Network>

Mutable store has a converter that needs to know how to go from network to local or from output to local
Source of truth will know how to write a local or read an output

Store never needs to know how to convert local to output, if user has same local read and write they would set local and output type to be same

Builders will hide all the generic mess :-)

Froma functionality perspective users will be able to:

  • Create a store with different read and write types
  • Create a store with same read write types
  • Create a mutable store with same read and write types
  • Create a mutable store with different read and write types
  • Have ability to write locally

Thoughts @matt-ramotar ?

@matt-ramotar
Copy link
Collaborator

SGTM 👍🏽

@matt-ramotar matt-ramotar moved this from 🆕 Triage to 👀 In review in Store Roadmap Jun 17, 2023
@matt-ramotar matt-ramotar added this to the Codebase Cleanup milestone Jun 17, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Store Roadmap Jul 5, 2023
@SteinerOk
Copy link

Hey @digitalbuddha, any ETA for this release?
I want to migrate from v4 to v5, but cannot via this bug(

@digitalbuddha
Copy link
Contributor Author

There is a snapshot available now, we are targeting next week for a beta01 release. Thank you for patience, I'm old and commit to too many things 😅

@jsilva05
Copy link

Hi!
Any news on the new release?
Thanks!

@digitalbuddha
Copy link
Contributor Author

https://github.com/MobileNativeFoundation/Store/releases/tag/5.0.0-beta02 Is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants