[ZEPPELIN-6634] Download service prepends a UTF-8 BOM to JSON files, breaking standard parsers #5449
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 354 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.351
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5449"
general
weight: 0.35
jongyoul
What is this PR for?
Downloaded
.zplnand.ipynbfiles start with a UTF-8 BOM, which the JSON specification does not allow, so strict parsers refuse them:Zeppelin reads its own files back because Gson tolerates the BOM, which is why this went unnoticed until a downloaded
.ipynbwas opened in Jupyter.The BOM was added in ZEPPELIN-672 so Excel reads a CSV export as UTF-8, but it lives in the shared download service, so the
zplnandipynbexports that later reused that service inherited it.This makes the caller decide:
saveAs()takes abomflag defaulting tofalse, and only the CSV/TSV call site passestrue. Of the six call sites, that is the only one that needs it — the new UI has none at all, since its CSV/TSV export goes through thexlsxlibrary.| Call site | Format | BOM |
|---|---|---|
|
result.controller.js| CSV / TSV | yes ||
notebook.controller.js(x2) | zpln | no ||
websocket-event.factory.js| ipynb | no ||
action-bar.component.ts(x2) | zpln (new UI) | no |Both UIs are fixed together, and the classic service drops the BOM in both its IE and standard branches.
What type of PR is it?
Bug Fix
Todos
[x] Add a
bomflag to bothsaveAs()services, defaulting to off[x] Opt the CSV/TSV call site in, leaving the JSON exports without a BOM
[x] Add unit tests asserting the bytes on both paths
What is the Jira issue?
ZEPPELIN-6634
How should this be tested?
New spec
save-as.service.spec.tschecks the raw bytes handed tocreateObjectURL, sinceBlob.text()decodes and strips a leading BOM: azplnexport has no BOM and parses as JSON, and a CSV export withbom: truekeepsEF BB BF.Result:
Tests 31 passed (31).Manual, on a built server: export a note as
.zplnand download a table result as CSV.The zpln no longer starts with a BOM and Python parses it, while the CSV still carries one. Korean, Chinese and emoji survived in both.
Screenshots (if appropriate)
N/A
Questions:
Does the license files need to update? No
Is there breaking changes for older versions? No — the flag defaults to off, and CSV/TSV keeps the BOM it had