-
Notifications
You must be signed in to change notification settings - Fork 16
feat: use yjs as the source-of-truth #440
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
Conversation
This feature is roughly usable. I'm merging this so that people can work on top of this, and avoid merge conflicts, as this PR is too large and touches everything. Remaining problems:
|
Note: DB schema changed. You need to apply the migration and recreate your docker stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A regression bug in two places.
let siblings = get().node2children.get(parentId) || []; | ||
const siblings = nodes.filter((node) => node.parentNode === parentId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug: previous siblings are IDs, new siblings are Nodes.
let children = get().node2children.get(id); | ||
const children = nodes.filter((n) => n.parentNode === id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug: ditto
This is a major change. Close #331
Before
Previous architecture (detailed in #205) is centered around the browser (
yjs <-> browser <-> DB
), which is problematic because:After
Now we are changing to Yjs-centered (
browser <-> Yjs <-> DB
). Yjs is the single source-of-truth.Details
This PR removes a lot of syncing logic/functions from front-end, notably those
addPod
,loadRepo
,setPodGeo
reducers.TODOs: