OnlyOffice Document Server version 9.0.2
Implementation Details:
We have implemented a streaming text insertion feature using OnlyOffice Plugin API. Here’s how we use it:
- Frontend Integration:
- Load OnlyOffice editor with custom plugin
- Use
window.docEditor.serviceCommand('InsertCharacter', {...})to send characters - Stream characters one by one or in small batches (3-10 characters)
- Plugin Implementation:
// In our custom plugin (main.js)
function handleInsertCharacter(options) {
AscPlugin.callCommand(function() {
var oDocument = Api.GetDocument();
var character = options.character;
var oLastParagraph = oDocument.GetElement(oDocument.GetElementsCount() - 1);
oRun.AddText(character);
consolo.log(“success”)
});
} - Streaming Process:
window.docEditor.serviceCommand(‘InsertCharacter’, {
character: character
})
- Each character sent with 40ms delay between calls
- Characters are Chinese text (UTF-8 encoded)
Problem Description:
We consistently experience character loss at specific character counts (around 60-70 characters), regardless of the insertion method:
- Consistent Pattern:
- Problem always occurs around 60-70 characters
- Happens whether we send 1 character, 3 characters, or 10 characters per batch
- Issue is related to total character count, not number of API calls
- Observed Behavior:
- Frontend logs show
serviceCommandcalls are successful - Plugin receives the commands (outer logs print correctly)
- But
AscPlugin.callCommandinner function doesn’t execute (success not log) - subsequent characters insert normally
Questions:
Is there an internal checkpoint/autosave mechanism that triggers around 60-70 characters?
Does OnlyOffice have document content thresholds that pause API processing?
Are there WebSocket buffer limits or internal queues that might cause this?



