You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "Ma77Ball (via GitHub)" <gi...@apache.org> on 2026/09/11 07:44:56 UTC
Re: [PR] fix(amber, frontend): inline Hugging Face audio uploads as data URLs instead of a server temp file [texera]
Ma77Ball commented on code in PR #7790:
URL: https://github.com/apache/texera/pull/7790#discussion_r3986956247
##########
frontend/src/app/workspace/component/hugging-face-audio-upload/hugging-face-audio-upload.component.ts:
##########
@@ -94,51 +67,34 @@ export class HuggingFaceAudioUploadComponent extends FieldType<FieldTypeConfig>
input.value = "";
return;
}
- this.revokePreviewUrl();
- const previewUrl = URL.createObjectURL(file);
- this.localPreviewUrl = previewUrl;
- this.isUploading = true;
+ if (file.size > MAX_AUDIO_BYTES) {
+ this.errorMessage = "Audio file is too large (max 25 MB).";
+ input.value = "";
+ return;
+ }
Review Comment:
**What is wrong:** the two reject branches (non-audio at line 65, over-cap here at 70-74) set `errorMessage` and `return` without clearing any previously stored value.
**Why it matters:** if the user already selected a valid clip and then picks an invalid or oversized file, `formControl.value` and `fileName` still hold the old clip, so the `<audio>` preview keeps playing and the operator runs the *previous* audio while the UI shows an error, a silent wrong-input. The reject tests all start from an empty control, so this path is uncovered.
**Suggested fix:** reset selection state in both reject branches. Extract a small `resetSelection(input)` that clears the form value, `fileName`, and `input.value`, and call it where you currently only set `errorMessage`. If keeping the last valid clip is intentional, say so in a comment so the error-plus-preview state is not read as a bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org