Repository navigation
fix: harden asset parsing and import hooks - #16494
christian-byrne wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAsset metadata parsing now tolerates malformed optional fields. A1111 graph import now awaits an optional asynchronous callback before clearing and rebuilding the graph. Tests cover both behaviors. ChangesAsset parsing and graph import synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change preserves valid asset fields when optional metadata is malformed and waits for asynchronous cleanup before replacing an imported graph. Coverage and passing CI indicate no remaining merge-blocking risk. Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: End-To-End Regression Coverage For FixesExplanation The available metadata lists changes under Resolution Provide the PR title and commit subjects. Then verify whether either contains the specified bug-fix language; if so, require either a Playwright regression test under ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: 🚧 Building...🎭 Playwright: ✅ 1916 passed, 0 failed📊 Browser Reports
📦 Bundle: 9.68 MB gzip 🔴 +145 BDetailsSummary
Category Glance App Entry Points — 3.74 kB (baseline 3.74 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.42 MB (baseline 1.42 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 621 kB (baseline 621 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 17 unchanged User & Accounts — 27.8 kB (baseline 27.8 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 117 kB (baseline 117 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 8 unchanged Data & Services — 3.59 MB (baseline 3.59 MB) • 🔴 +33 BStores, services, APIs, and repositories
Status: 13 added / 13 removed / 3 unchanged Utilities & Hooks — 560 kB (baseline 560 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 18 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 16.4 MB (baseline 16.4 MB) • ⚪ 0 BBundles that do not match a named category
Status: 72 added / 72 removed / 224 unchanged ⚡ Performance
|
…ssetSchema test - Export persistThumbnailFromDataUrl (fetches data URL → Blob → delegates to persistThumbnail) - Fix formatting of as const each block in mediaAssetSchema.test.ts
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #16494 +/- ##
==========================================
+ Coverage 82.25% 82.52% +0.26%
==========================================
Files 2017 2033 +16
Lines 116536 118025 +1489
Branches 31039 30154 -885
==========================================
+ Hits 95856 97397 +1541
+ Misses 20505 20451 -54
- Partials 175 177 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 225 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Lifecycle update (cheap-drain lane, act-fe-16494-cifix): Draft PR undrafted → ready for review. All CI green (79 pass / 15 skip / 0 fail). Prior state: 17 failing checks (draft). Root cause: CI failures resolved. Current head passes lint-and-format, scan, setup, storybook-build, custom_nodes_e2e (all 7 shards), playwright (all variants), perf-tests, ecosystem-matrix (all shards). Assignees: benjcooley + ryan-di + CodeJuggernaut (roster triple-assign). Ready for human review. |
|
CI green — root-cause fixes for 17 failing checks. Two issues fixed in
All 79 checks passing, 0 failures, 0 pending. |
|
@coderabbitai review |
|
Every thumbnail caller already hands persistThumbnail a Blob, so the data-URL wrapper had no callers outside its own test.
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed at c091e98. The PR body says the tests could not be run on the worker, so I ran them here: the three touched suites pass (27 tests), the whole src/platform/assets tree passes (52 files, 776 tests), and vue-tsc is clean.
issue: persistThumbnailFromDataUrl had no callers. Every thumbnail producer on main (saveMesh.ts, useLoad3d.ts, useLoad3dViewer.ts, modelThumbnail.ts) already hands persistThumbnail a Blob from canvas.toBlob, so the data-URL wrapper existed only so its ported test would compile (that is what b205fde added it for). Fixed in c091e98 by removing the function and assetPreviewUtil.persistFromDataUrl.test.ts; assetPreviewUtil.ts is now identical to main.
The fail-soft parsing change is worth keeping. MediaAssetCard.vue dragStart writes attachment_ref from getAssetUrlFilename, which can be an empty string, and under the old intersection schema that single field failed the whole payload so getDroppedAsset fell back to the uri-only path with no media_kind or preview_url. With .extend plus .catch(undefined) the base item survives and only the bad field is dropped, which is what the new it.for cases pin. Switching .and to .extend is safe here because zResultItem is a plain z.object, so key stripping behaves the same either way.
One open question inline on the beforeGraphClear widening.
| graph: LGraph, | ||
| parameters: string, | ||
| beforeGraphClear?: () => void | ||
| beforeGraphClear?: () => void | Promise<void> |
There was a problem hiding this comment.
question: the only caller, app.ts around line 2102, passes a synchronous hook that calls beforeLoadNewGraph and canvas.setGraph inline, so nothing on main needs the Promise return yet. Is an async caller coming in a later port, or is this widening speculative? Awaiting a sync hook also inserts a microtask yield between the hook and graph.clear(); harmless today, but if the intent is only to future-proof it may be simpler to land the widening together with the caller that needs it.
|
@coderabbitai review |
|
Summary
Ports the disjoint asset parsing, thumbnail persistence, and async A1111 import hardening from the audited salvage ref onto current main.
Changes
Review Focus
Please check the fail-soft optional-field parsing boundary and the ordering guarantee around beforeGraphClear. The source was deduplicated against current main and open PRs #16385, #16430, and #16492; dialog-token and select-only workflow hunks were intentionally excluded.
Tests could not be executed on amp-worker-pk0z because /data had 11 MiB free and this fresh sparse checkout has no dependencies. git diff --check passes; exact-head CI is the execution gate.