发布

  • [OPIK-3438] [FE] Add async MIME type detection for extension-less media URLs (#4426)

    frostbyte_neo 发布于 2025-12-12 15:39:08 +00:00

    • [OPIK-3438] [FE] Refactor CompareExperimentsOutputCell to use media type detection hook

    • Revision 3: Fix test to account for HEAD + GET fallback strategy

    • Revision 4: Address critical PR feedback

    • Fix race condition in useProcessedInputData hook (prevents stale media updates)
    • Add security fix: don't retry GET for 403/404 HTTP errors
    • Improve error handling: only fallback to GET for network errors, not HTTP errors
    • Add test coverage for 403 and 404 error scenarios
    • Revision 5: Extract shared helper to eliminate code duplication
    • Create shared createMediaData() function in media.ts
    • Remove duplicated media data construction logic from useMediaTypeDetection hook
    • Both detectMediaFromUrl() and useMediaTypeDetection now use the same helper
    • Improves maintainability and ensures consistency across codebase
    下载附件