codepair-old
codepair-old copied to clipboard
Page is stop for more than 1MB text edition.
What happened:

I tried to copy and paste 2^20bytes text but the request failed and tried infinitely.
instrument.ts:130 YORKIE E:
[PP] c:"d3d1899d-b351-44798-c09e-9ceb68d0077"
err : B {message: 'grpc: received message larger than max (27740248 vs. 4194304)',
stack: 'Error: grpc: received message larger than max (277…rkie.dev/static/js/2.38ba4ecc.chunk.js:2:2256601)',
code: 8, metadata: {…}
What you expected to happen:
How to reproduce it (as minimally and precisely as possible): edit over 2^20bytes at once.
Anything else we need to know?:
Environment:
- Operating system: Windows 10
- Browser and version: Chrome, lastest
Could I try this issue?!
@kjw7953 Thank you for your contribution.
https://codepair.yorkie.dev/9340gq There was a data conflict in the CodePair document that you wrote while organizing this issue. To fix the problem, I would like to ask about the editing situation.
Did you see the text crack in your client view while you were writing the document? Or was the text normal while you were editing?
@Eithea Hi, there was no crack in my view when I was writing. I checked that page again two hours after I wrote it, and there was also no problem.
FYI, when I use the codepair for the first time (7.14), the conflict occurred almost immediately.
@kjw7953 Thank you for your answer.
Considering your answer, the client's local replica editing works normally because of recent bug-fixes. But there seems to be something wrong yet with the process of applying it in the docs of server DB. Your answer was very helpful in finding the cause of the problem. I'll try to fix it quickly.
We can consider the following approach:
Approach 1. Splitting the big contents in CodePair
For example:
const bigContent = '...';
const contents = bigContent.splitXXX();
const offset = 0;
for (const content of contents) {
document.update((root) => {
root.text.edit(offset, offset, content);
offset += content.length;
});
}
- CodePair: Split a big content into chunk contents and update them one by one. This will store changes in
doc.localChanges. - JS SDK: Add
MaxRecvMsgSizeoptions toClient. We can set the value ofMaxRecvMsgSizeon the server to the client. - JS SDK: The client collects changes from
doc.localChangesuntil the size of changes less than theMaxRecvMsgSizeand then sent them when callingclient.sync.
If only a part of the change succeeds in sending and the rest fails, there may be a problem that only part of the pasted content remains in the document.