Summary
When API calls fail during modal opening, the widget remains in a permanent shimmer/loading skeleton state with no error feedback, no timeout, and no way for consumers to detect the failure.
Location
File: src/modal/modal-manager.ts — Lines 47-62
File: src/asset/asset-service.ts — Lines 67-70, 89-92, 117-120
Problem
When the modal opens, ModalManager.updateModal() fires three parallel API calls (fetchAsset, hasNftProduct, fetchAssetMetadata). Each function catches all errors and silently returns undefined or false.
When fetchAsset returns undefined:
updateModalAsset silently bails out (line 90: if (!assetModel) return)
_assetLoaded never becomes true
- The modal stays in shimmer skeleton state indefinitely
This affects:
- Network failures (offline, DNS, timeouts)
- API downtime (500, 503 errors)
- Invalid
nid values (404 responses)
- Rate limiting (429 responses)
Impact
- User experience: Users see an eternally-loading widget with no explanation and no call to action
- Developer experience: No programmatic way to detect failure — no error event, no rejected promise, no error state property
- Debugging: Errors only appear in
console.error, invisible to end users and site operators
Suggested Implementation
-
Add _loadError state to CaptureEyeModal:
@state() protected _loadError = false;
When set, render a user-friendly message (e.g., "Unable to load provenance data") instead of the shimmer skeleton.
-
Add timeout in ModalManager.updateModal(): if fetchAsset does not resolve within 10 seconds, set the error state.
-
Dispatch custom error event from <capture-eye>:
this.dispatchEvent(new CustomEvent('capture-eye-error', {
detail: { nid: this.nid, error: 'Failed to load asset data' },
bubbles: true,
composed: true
}));
-
Expose loading state property on <capture-eye> (loadingState: 'loading' | 'loaded' | 'error') for programmatic access.
-
Optional single retry with 2-3 second backoff for transient failures.
Summary
When API calls fail during modal opening, the widget remains in a permanent shimmer/loading skeleton state with no error feedback, no timeout, and no way for consumers to detect the failure.
Location
File:
src/modal/modal-manager.ts— Lines 47-62File:
src/asset/asset-service.ts— Lines 67-70, 89-92, 117-120Problem
When the modal opens,
ModalManager.updateModal()fires three parallel API calls (fetchAsset,hasNftProduct,fetchAssetMetadata). Each function catches all errors and silently returnsundefinedorfalse.When
fetchAssetreturnsundefined:updateModalAssetsilently bails out (line 90:if (!assetModel) return)_assetLoadednever becomestrueThis affects:
nidvalues (404 responses)Impact
console.error, invisible to end users and site operatorsSuggested Implementation
Add
_loadErrorstate toCaptureEyeModal:When set, render a user-friendly message (e.g., "Unable to load provenance data") instead of the shimmer skeleton.
Add timeout in
ModalManager.updateModal(): iffetchAssetdoes not resolve within 10 seconds, set the error state.Dispatch custom error event from
<capture-eye>:Expose loading state property on
<capture-eye>(loadingState: 'loading' | 'loaded' | 'error') for programmatic access.Optional single retry with 2-3 second backoff for transient failures.