Skip to content

Commit d84498f

Browse files
ELin2025claude
andcommitted
fix(frontend): guard concurrent uploads and remove dead test in audio upload component
Add early return in onFileSelected when isUploading is true to prevent race conditions from concurrent file selections. Remove the second spec test that had a dead metadata variable and duplicated the first test's assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c2a6cff commit d84498f

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

frontend/src/app/workspace/component/hugging-face-audio-upload/hugging-face-audio-upload.component.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,4 @@ describe("HuggingFaceAudioUploadComponent (unit)", () => {
2323
it("should be defined", () => {
2424
expect(HuggingFaceAudioUploadComponent).toBeDefined();
2525
});
26-
27-
it("should have the correct selector", () => {
28-
const metadata = Reflect.getOwnPropertyDescriptor(HuggingFaceAudioUploadComponent, "__annotations");
29-
// Component decorator metadata is available via the Angular compiler;
30-
// at minimum verify the class is importable and constructable metadata exists.
31-
expect(HuggingFaceAudioUploadComponent.prototype).toBeDefined();
32-
});
3326
});

frontend/src/app/workspace/component/hugging-face-audio-upload/hugging-face-audio-upload.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export class HuggingFaceAudioUploadComponent extends FieldType<FieldTypeConfig>
7171
}
7272

7373
async onFileSelected(event: Event): Promise<void> {
74+
if (this.isUploading) {
75+
return;
76+
}
7477
this.errorMessage = "";
7578
const input = event.target as HTMLInputElement;
7679
const file = input.files?.[0];

0 commit comments

Comments
 (0)