-
Notifications
You must be signed in to change notification settings - Fork 13
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
✨(frontend) persistance-documents #62
Conversation
8df6c1f
to
400ff01
Compare
b2874ea
to
3be4ad5
Compare
3be4ad5
to
d53af72
Compare
src/helm/helmfile.yaml
Outdated
- id: Expiration | ||
status: enabled | ||
expiry: | ||
noncurrentDays: 100 |
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.
so if you do that all versions will be deleted after 100 days and we keep only the last version?
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.
Yes it is that: https://min.io/docs/minio/linux/administration/object-management/create-lifecycle-management-expiration-rule.html, it should make the deletion automatic.
By default we can have 10000 versions, it is about 5kg per version (even less) gives us max about 50mo per doc.
After, I think we should add a system where the user can save voluntary a version (copy of doc ?), and this "version" will not have an expiration.
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.
Anyway, for the moment we are not sure how to setup this config with our host. I think we can remove this commit for the moment (🔧(minio) set version expiration) and add it in another PR.
d53af72
to
7aa945b
Compare
We stopped throwing errors on id pages, often Next.js just need a rerender to get the id from the router correctly.
Create a react query hook to update a pad. PATCH /documents/:id
Adapt some pad types.
This commit manage the persistance of the pad. We save the pad in different ways: - when the user close the tab or the browser - when the user leave the page (go to another pad by example) - every 1 minute ---- - We save the pad only if the pad has been modified. - Pads are collaborative, to not save multiple times the same pad, we save the pad only if the user is the last to have modified the pad. ---- Because of the collaborative aspect of the pads, the best way to store our pad is to save the Y.Doc, to do so the recommended way is to convert the Y.Doc to a Uint8Array and then to a string (base64). Our pad are saved as a string in a object in a Minio bucket.
It is the webrtc server that will be responsible for managing the data of the BlockNote Editor. So to restore the data of a saved pads, we have to add the initial pad to the room of the webrtc server, it will then update the data of BlockNote Editor. The webrtc server accept Y.Doc, so we convert our base64 data from Minio to make it compatible with the server. By doing so, we avoid the problem of data lost when multiple users are connecting and one user already updated the data of the BlockNote Editor before saving it.
Saved documents has to be a string now. Before it has to be a json object.
7aa945b
to
cfa0983
Compare
Purpose
This PR manage the persistance of the documents.
We save the documents in different ways:
Because of the collaborative aspect of the pads, the best way to store our pad is to save the Y.Doc, to do so the recommended way is to convert the Y.Doc to a Uint8Array and then to a string (base64).
Our pad are saved as a string in a object in a Minio bucket.
Proposal