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

Provide a way for map to initialize its schema #27

Closed
zxch3n opened this issue Nov 23, 2022 · 1 comment
Closed

Provide a way for map to initialize its schema #27

zxch3n opened this issue Nov 23, 2022 · 1 comment

Comments

@zxch3n
Copy link
Member

zxch3n commented Nov 23, 2022

Commonly, a map container has a schema. There is no way to initialize the schema in the current version. It's fine if the values of the entries are JSON values. But it may be problematic if the value is a Container.

Consider the following example.

struct TodoList {
    todos: List
}

Users may initialize the todos field concurrently and insert a to-do item concurrently. However, in the current implementation, one user's edits will override the other's and thus only have a to-do item in the list.

The current workaround in the application code is to initialize all fields immediately after creating the map. But by using this approach, there is still potential data loss when the schema is changed.

Solution

We may need alias of container to support this feature. i.e., there may exist two different ids that point to the same container.

@zxch3n
Copy link
Member Author

zxch3n commented Aug 4, 2023

It's too complex. Users can initialize those fields before syncing the container to avoid concurrent edits.

@zxch3n zxch3n closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant