Summary
With Univer CLI 0.4.0, univer execute --script can remain running indefinitely with no stdout or stderr while applying style-only changes to an existing Sheet worktree.
Environment
- Univer CLI: 0.4.0
- macOS
- Package:
harbourline-q3-qbr-deep-ocean.univer
- Unit:
Ct1A0c
- Worktree:
wt-mshcgd6y-xpojxs
- Target sheet:
Sales Data
Command
univer execute harbourline-q3-qbr-deep-ocean.univer \\
--worktree wt-mshcgd6y-xpojxs \\
--unit Ct1A0c \\
--script style-sales-data-semantic.js \\
--json
Actual behavior
After earlier API validation errors were corrected, the execute call produced no output for more than two minutes. Polling the process also returned empty output. The process had to be interrupted manually and exited with code 130.
There was no success payload, failure payload, progress event, timeout, or indication whether the worktree commit was written.
A rewritten version of the same operation that reduced hundreds of per-cell formatting calls to bounded range operations completed successfully in about 29 seconds and committed as worktree commit 5. This suggests the original path may be hanging or taking unbounded time during command application/commit rather than failing fast.
Expected behavior
- Return a success/error JSON response within a bounded time.
- Emit progress or diagnostics during a long commit.
- Support an explicit timeout.
- Make commit state unambiguous after interruption.
Script operations
The script only:
- sets backgrounds, font colors and font weights on
Sales Data!A1:J73;
- preserves three data-validation rules and changes only their render mode;
- preserves three conditional-formatting rules;
- hides default gridlines;
- returns a small JSON summary.
No values, formulas, rows, columns, charts, or workbook structure are changed.
Additional verification
After the optimized execution completed:
- formula errors: 0
- data validation errors: 0
- chart count: 18
- key values remained
$1,140,562 and $1,405,552
Original per-cell script
const sheet = workbook.getSheetByName('Sales Data');
if (!sheet) throw new Error('Sales Data sheet not found');
sheet.getRange('A1:J73').setFontColor('#111A2E').setVerticalAlignment('middle');
for (let row = 2; row <= 73; row += 1) {
sheet.getRange(`A${row}:J${row}`).setBackground(row % 2 === 0 ? '#FFFFFF' : '#F7F9FC');
const month = String(sheet.getRange(`A${row}`).getValue() ?? '');
const region = String(sheet.getRange(`B${row}`).getValue() ?? '');
// The full repro used direct per-cell semantic background/font calls here.
sheet.getRange(`C${row}`).setBackground('#EEF2F7').setFontColor('#22365F').setFontWeight('bold');
sheet.getRange(`J${row}`).setBackground('#E7F7F3').setFontColor('#2E7D6E').setFontWeight('bold');
}
sheet.getRange('A1:J1').setBackground('#22365F').setFontColor('#F5F7FF').setFontWeight('bold');
for (const validation of sheet.getDataValidations()) {
validation.setOptions({ showDropDown: true, renderMode: 1 });
}
sheet.setHiddenGridlines(true);
return {
validationsPreserved: sheet.getDataValidations().length,
conditionalFormatsPreserved: sheet.getConditionalFormattingRules().length,
};
The complete .univer repro package is attached.
harbourline-q3-qbr-orphan-chart-repro.zip
Summary
With Univer CLI 0.4.0,
univer execute --scriptcan remain running indefinitely with no stdout or stderr while applying style-only changes to an existing Sheet worktree.Environment
harbourline-q3-qbr-deep-ocean.univerCt1A0cwt-mshcgd6y-xpojxsSales DataCommand
Actual behavior
After earlier API validation errors were corrected, the execute call produced no output for more than two minutes. Polling the process also returned empty output. The process had to be interrupted manually and exited with code 130.
There was no success payload, failure payload, progress event, timeout, or indication whether the worktree commit was written.
A rewritten version of the same operation that reduced hundreds of per-cell formatting calls to bounded range operations completed successfully in about 29 seconds and committed as worktree commit 5. This suggests the original path may be hanging or taking unbounded time during command application/commit rather than failing fast.
Expected behavior
Script operations
The script only:
Sales Data!A1:J73;No values, formulas, rows, columns, charts, or workbook structure are changed.
Additional verification
After the optimized execution completed:
$1,140,562and$1,405,552Original per-cell script
The complete
.univerrepro package is attached.harbourline-q3-qbr-orphan-chart-repro.zip