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

read after optimistic write & optimistic reactivity #55

Open
tantaman opened this issue Aug 19, 2022 · 0 comments
Open

read after optimistic write & optimistic reactivity #55

tantaman opened this issue Aug 19, 2022 · 0 comments

Comments

@tantaman
Copy link
Collaborator

If a user strictly performs optimistic writes (without awaiting for the write to complete) they can issue a read that doesn't return what they expect.

The current design requires hitting the database to fulfill any query. So issuing a write that you don't await can result in a later query not returning the data in that write.

We can:

  1. Update our query layer to understand if there are pending writes. If so, await them before returning the read.
    ^-- I think this might already be the case accidentally when using wa-sqlite-connector as all those operations are serialized

When we make changes for #46 we'll have to consider how it impacts this task.

Reactive queries do not update optimistically. This might not be a big deal but could lead to strange behavior where a component lags behind another. When tackling #49 we can address parts of this problem. E.g., by making single hop reactive queries resolve themselves in-memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant