Why limit the number of steps sent to the server? #6
Replies: 2 comments 3 replies
|
@smoores-dev I believe this was an attempt to limit the "chunkiness" of any given document update while under heavy load. It should probably be exposed through |
|
TL;DR This has been addressed in #9 The use case for this setting is documents with a high number of active editors each with variable network conditions and high edit velocity. Example:
The commit represents a unit of work that must be applied atomically. Limiting the number of steps in each commit is a tunable to facilitate more fine grain interleaving of edits on the backend, and lower latency application of the broadcast commits on the client side. Applying a single step, full document paste uses far less resources(CPU time and memory) than processing the 60k individual steps that originally constructed the document. Limiting commit size helps limit "apply" time of any one commit and thus helps mitigate typing latency(keystroke to paint). Smaller commits provide a "smoother" editor experience compared to "chunky" updates when integrating remote commits. In my client this is just a sanity cap; commit size grows naturally with confirmation latency. |
Uh oh!
There was an error while loading. Please reload this page.
In
getCommit, there's a hard cap on the number of steps included in a commit: https://github.com/stepwisehq/prosemirror-collab-commit/blob/main/src/collab-commit.ts#L122. It's set to 20 — it seems as if it was maybe meant to be configurable at one point, but it isn't actually exposed directly to users.Is there a reason for this cap?
All reactions