fix(import): refuse empty parsed imports under replace-all (#412) #426
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 241 lines diff across 3 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.328
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #426"
general
weight: 0.35
qwts
Closes #412
Summary
src/utils/importHandlers.js(executeJsonImport/executeHtmlImport) and wiresBookmarkApp.jsxthrough them.replaceAllwheneverbookmarksToImport.length === 0(empty JSON arrays, unsafe-URL-only JSON, empty/malformed Netscape HTML, or unsafe-URL-only HTML), showingapp.replaceAllEmptyRefused("error") and never invokingsaveAllBookmarks(bulkReplace),appendBookmarks, orclearLastAction.ImportConfirmCard.jsxto showimportExport.willReplace("This will replace your collection with <strong>{count}</strong> bookmark(s).") including0while keeping Confirm disabled atcount === 0, and adds an expliciteffectiveImport.count === 0guard insideImportExportContent.jsx#executeImport.src/utils/importHandlers.test.js(JSON empty, JSON unsafe-only, JSONskipExisting: false, HTML empty, HTML unsafe-only, plus valid replace-all runs) and updatessrc/components/ImportExportContent.test.jsxwith zero-count replace-all card coverage..changeset/import-replace-all-empty-guard.md.Verification
npm run format,npx eslint --max-warnings=0 src/utils/importHandlers.js src/utils/importHandlers.test.js, andnpm run ci </dev/nullpassed cleanly (Test Files 139 passed (139),Tests 1679 passed (1679), Chrome MV3 build, chunk laziness check, third-party notices check, version policy check, and Storybook build all succeeded).saveAllBookmarks/bulkReplace/initialPendingImportaudited (bookmarkUndo.jsintentionally passesreplaced || []on undo and remains unaffected).<!-- agent-bot-write: ghw_35a0e83d90cec1dc session=210bdd5e08f0 bot=trueline-antigravity-agent[bot] conversation_id=e99b26b3-53f9-4d7f-8337-fb33257bb240 conversation_id_source=self-reported -->