feat(hoster): resolve MediaFire, PixelDrain and Gofile downloads - #172
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR hardens protected hoster downloads with bounded plugin parsing, typed errors, source-policy validation, refreshed resolutions, ownership-aware cleanup, remote metadata propagation, and Link Grabber probe and error handling. ChangesProtected hoster download hardening
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Merging this PR will degrade performance by 2.67%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | from_status_code_500 |
94.7 ns | 123.9 ns | -23.54% |
| ❌ | normalize_link_check_parallelism |
120.8 ns | 150 ns | -19.44% |
| ❌ | split |
413.6 ns | 471.9 ns | -12.36% |
| ⚡ | from_status_code_200 |
123.3 ns | 94.2 ns | +30.97% |
| ⚡ | from_status_code_404 |
153.1 ns | 123.9 ns | +23.54% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/mat-133-hoster-resolution (96bc775) with main (a5f83b4)
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src-tauri/src/adapters/driven/plugin/extism_loader.rs (1)
531-539: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve hoster errors during credentialed extraction.
The
Some(credential)branch only callsclassify_account_plugin_error, so hoster failures such asHOSTER_NO_FILE, HTTP 410, or password-required are downgraded to a genericPluginError. Apply account-code detection first, then fall back toclassify_hoster_plugin_error, and add a credentialed regression test.Proposed fix
+fn classify_credentialed_hoster_plugin_error(message: &str) -> DomainError { + if has_error_code(message, "ACCOUNT_INVALID_CREDENTIALS") + || has_error_code(message, "ACCOUNT_EXPIRED") + || has_error_code(message, "ACCOUNT_COOLDOWN") + || has_error_code(message, "ACCOUNT_QUOTA_EXCEEDED") + { + classify_account_plugin_error(message) + } else { + classify_hoster_plugin_error(message) + } +} + let output = match credential { Some(credential) => self .registry .call_plugin_with_credential(service_name, "extract_links", url, credential.clone()) - .map_err(|error| classify_account_plugin_error(&error.to_string()))?, + .map_err(|error| { + classify_credentialed_hoster_plugin_error(&error.to_string()) + })?,Also applies to: 952-1004
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/adapters/driven/plugin/extism_loader.rs` around lines 531 - 539, The credentialed extraction path in the match handling extract_links must preserve hoster-specific failures. Update the Some(credential) branch to detect account errors first, then fall back to classify_hoster_plugin_error for hoster cases such as HOSTER_NO_FILE, HTTP 410, and password-required; leave the uncredentialed branch unchanged and add a regression test covering credentialed extraction.src-tauri/src/application/commands/resolve_links.rs (1)
284-315: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winValidate Gofile URLs before invoking account or plugin resolution.
The current checks run only in
into_hoster_resolution, afterextract_hoster_links, and are skipped entirely when an account is picked. Thus userinfo/non-default-port URLs reach the resolver before rejection. Prevalidateurlat the start ofresolve_hoster_linkswhenservice_name == "vortex-mod-gofile".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/application/commands/resolve_links.rs` around lines 284 - 315, The resolve_hoster_links method must validate Gofile URLs before any account selection or plugin invocation. At the start of resolve_hoster_links, when service_name is "vortex-mod-gofile", perform the existing URL validation that rejects userinfo and non-default-port URLs, returning its error immediately; leave other services and the subsequent account/plugin resolution flow unchanged.
🧹 Nitpick comments (2)
src-tauri/src/application/commands/resolve_links_tests.rs (1)
203-234: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the typed error kinds, not only their messages.
These tests cover quota and cooldown classification but never verify the new
error_kindcontract. Add assertions for the correspondingLinkResolutionErrorKindvariants so frontend routing cannot regress unnoticed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/application/commands/resolve_links_tests.rs` around lines 203 - 234, Update the tests resolve_hoster_surfaces_persisted_exhaustion_without_free_fallback and resolve_hoster_preserves_persisted_cooldown_without_free_fallback to assert result[0].error_kind matches the corresponding LinkResolutionErrorKind variants for quota exhaustion and cooldown, while preserving the existing status, message, and cleanup assertions.src-tauri/src/application/commands/start_download.rs (1)
217-218: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winGate external test modules from production builds. Both declarations omit
#[cfg(test)], so their mock-heavy suites are compiled outside test builds.
src-tauri/src/application/commands/start_download.rs#L217-L218: add#[cfg(test)]before the path attribute.src-tauri/src/application/commands/resolve_links.rs#L575-L580: add#[cfg(test)]beforeresolve_links_hoster_tests.rs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/src/application/commands/start_download.rs` around lines 217 - 218, Gate both external test modules with test-only configuration: in src-tauri/src/application/commands/start_download.rs lines 217-218, add #[cfg(test)] to the tests module declaration, and in src-tauri/src/application/commands/resolve_links.rs lines 575-580, add it to the resolve_links_hoster_tests module declaration. No other changes are needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/adapters/driven/network/download_engine_hoster_tests.rs`:
- Around line 312-352: Strengthen
protected_hoster_attempt_never_deletes_an_unowned_destination by replacing
MockFileStorage with FsFileStorage or a deletion-recording spy. Ensure the test
observes delete_download_artifacts calls, asserting zero deletion requests while
preserving the existing failed outcome and user-owned destination content
checks.
In `@src-tauri/src/adapters/driven/network/download_engine_tests.rs`:
- Around line 258-263: Remove the race-dependent second cancel() call and its
is_ok assertion from the cancellation test. Instead, await and assert the
eventual DownloadCancelled event, preserving the test’s validation of successful
cancellation without assuming the task remains in active_downloads; only make
cancellation idempotent if that behavior is explicitly intended by the engine
contract.
In `@src-tauri/src/adapters/driven/network/download_engine.rs`:
- Around line 648-652: Update the total_size selection logic around
metadata.content_length and size_hint to compare both available values before
accepting Content-Length. Reject or fail the download when a positive
Content-Length differs from the supplied stable size_hint, while preserving the
existing fallback behavior when either value is unavailable.
- Around line 425-427: Update the AttemptOutcome::Failed handling so
AllMirrorsExhausted is emitted only when failure.retryable_with_mirror is true
and no further mirror_urls remain. Prevent terminal local failures from
publishing the event or resetting the persisted mirror cursor, while preserving
the existing mirror-retry flow.
- Around line 682-687: Update the None branch handling in the download
destination logic to return DomainError::AlreadyExists when no Vortex resume
metadata exists, regardless of source_policy, instead of calling
storage.delete_download_artifacts. Preserve the existing protected-branch error
behavior and message, and remove the unguarded deletion path.
In `@src-tauri/src/adapters/driven/network/download_source_preparation.rs`:
- Around line 56-80: The resolution path in the source-preparation method
hardcodes SourcePolicy::Protected instead of honoring the resolved source
classification. Use the ResolvedDownloadSource protected/direct marker when
constructing the policy, preserving direct response and cleanup semantics for
non-protected results while retaining protected behavior for protected results.
In `@src-tauri/src/adapters/driven/network/protected_source.rs`:
- Around line 117-138: Update html_prefix_decision so doctype detection accepts
all HTML whitespace between “doctype” and “html”, including tabs and newlines,
rather than relying on the literal spaced signature. Preserve the existing
NeedMore behavior for incomplete prefixes and Reject behavior for confirmed
HTML, and add a regression case covering non-space whitespace.
In `@src-tauri/src/application/commands/premium_account_resolution.rs`:
- Around line 97-104: Update the missing direct URL branch in the premium
account resolution flow to return the typed hoster-specific no-file error,
matching the free-hoster resolver’s `HosterNoFile` mapping instead of
`DomainError::PluginError`. Preserve the existing validation for absent or blank
URLs.
In `@src-tauri/src/application/commands/resolve_links.rs`:
- Around line 453-486: Update hoster_error_details to match
DomainError::NetworkError explicitly and return LinkResolutionErrorKind::Network
with an appropriate network-failure message, preventing it from reaching the
generic Plugin fallback.
---
Outside diff comments:
In `@src-tauri/src/adapters/driven/plugin/extism_loader.rs`:
- Around line 531-539: The credentialed extraction path in the match handling
extract_links must preserve hoster-specific failures. Update the
Some(credential) branch to detect account errors first, then fall back to
classify_hoster_plugin_error for hoster cases such as HOSTER_NO_FILE, HTTP 410,
and password-required; leave the uncredentialed branch unchanged and add a
regression test covering credentialed extraction.
In `@src-tauri/src/application/commands/resolve_links.rs`:
- Around line 284-315: The resolve_hoster_links method must validate Gofile URLs
before any account selection or plugin invocation. At the start of
resolve_hoster_links, when service_name is "vortex-mod-gofile", perform the
existing URL validation that rejects userinfo and non-default-port URLs,
returning its error immediately; leave other services and the subsequent
account/plugin resolution flow unchanged.
---
Nitpick comments:
In `@src-tauri/src/application/commands/resolve_links_tests.rs`:
- Around line 203-234: Update the tests
resolve_hoster_surfaces_persisted_exhaustion_without_free_fallback and
resolve_hoster_preserves_persisted_cooldown_without_free_fallback to assert
result[0].error_kind matches the corresponding LinkResolutionErrorKind variants
for quota exhaustion and cooldown, while preserving the existing status,
message, and cleanup assertions.
In `@src-tauri/src/application/commands/start_download.rs`:
- Around line 217-218: Gate both external test modules with test-only
configuration: in src-tauri/src/application/commands/start_download.rs lines
217-218, add #[cfg(test)] to the tests module declaration, and in
src-tauri/src/application/commands/resolve_links.rs lines 575-580, add it to the
resolve_links_hoster_tests module declaration. No other changes are needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e782aacd-7315-493a-a7e6-0a80454ba128
📒 Files selected for processing (46)
CHANGELOG.mdsrc-tauri/src/adapters/driven/filesystem/file_storage.rssrc-tauri/src/adapters/driven/network/download_artifact_lifecycle.rssrc-tauri/src/adapters/driven/network/download_engine.rssrc-tauri/src/adapters/driven/network/download_engine_hoster_tests.rssrc-tauri/src/adapters/driven/network/download_engine_test_support.rssrc-tauri/src/adapters/driven/network/download_engine_tests.rssrc-tauri/src/adapters/driven/network/download_source_preparation.rssrc-tauri/src/adapters/driven/network/mod.rssrc-tauri/src/adapters/driven/network/protected_source.rssrc-tauri/src/adapters/driven/network/safe_url.rssrc-tauri/src/adapters/driven/network/safe_url_tests.rssrc-tauri/src/adapters/driven/network/segment_worker.rssrc-tauri/src/adapters/driven/plugin/extism_loader.rssrc-tauri/src/adapters/driven/plugin/hoster_contract.rssrc-tauri/src/adapters/driven/plugin/hoster_contract_tests.rssrc-tauri/src/adapters/driving/tauri_ipc.rssrc-tauri/src/application/commands/hoster_download_source.rssrc-tauri/src/application/commands/mod.rssrc-tauri/src/application/commands/premium_account_resolution.rssrc-tauri/src/application/commands/premium_account_rotation.rssrc-tauri/src/application/commands/resolve_links.rssrc-tauri/src/application/commands/resolve_links_hoster_tests.rssrc-tauri/src/application/commands/resolve_links_tests.rssrc-tauri/src/application/commands/resolve_premium_source.rssrc-tauri/src/application/commands/resolve_premium_source_test_support.rssrc-tauri/src/application/commands/resolve_premium_source_tests.rssrc-tauri/src/application/commands/start_download.rssrc-tauri/src/application/commands/start_download_tests.rssrc-tauri/src/application/services/download_source_policy.rssrc-tauri/src/application/services/mod.rssrc-tauri/src/domain/error.rssrc-tauri/src/domain/model/download.rssrc-tauri/src/domain/ports/driven/download_source_resolver.rssrc-tauri/src/domain/ports/driven/file_storage.rssrc-tauri/src/domain/ports/driven/hoster_link.rssrc-tauri/src/domain/ports/driven/plugin_loader.rssrc-tauri/src/lib.rssrc-tauri/tests/app_state_wiring.rssrc/stores/linkGrabberStore.tssrc/views/LinkGrabberView/LinkGrabberView.tsxsrc/views/LinkGrabberView/LinkRow.tsxsrc/views/LinkGrabberView/ResolvedLinksSection.tsxsrc/views/LinkGrabberView/__tests__/LinkGrabberView.test.tsxsrc/views/LinkGrabberView/__tests__/LinkRow.test.tsxsrc/views/LinkGrabberView/types.ts
There was a problem hiding this comment.
cubic analysis
All reported issues were addressed across 46 files
Linked issue analysis
Linked issue: MAT-133: [Lot 2] Exécuter la résolution MediaFire, PixelDrain et Gofile avant téléchargement
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | R-01 — A URL MediaFire, PixelDrain or Gofile supported is resolved by its plugin before any download. | The PR adds a ResolveHosterSourceHandler, classifies protected hoster modules, and routes protected modules to plugin resolution before network access. StartDownload avoids the unrestricted HTTP adapter for protected modules and JIT-resolves via the DownloadSourceResolver. |
| ✅ | R-02 — The engine downloads the resolved direct content and never the original hoster page HTML as a false success. | New protected-source policies validate response prefixes and reject disguised HTML; the segment worker and engine were updated to use SourcePolicy and BodyPrefixDecision to enforce these checks. |
| ✅ | R-03 — The name, size and headers provided by the plugin are preserved in the download plan. | Hoster contract and ExtractedHosterLink now include filename/size/resumable/headers; ResolvedDownloadSource carries request_headers; StartDownload and the Tauri IPC forward plugin-supplied filename/size/resume flags into the StartDownloadCommand and engine. |
| ✅ | R-04 — An expired direct URL is re-resolved according to an explicit and tested rule. | New DomainError variant for expired direct URLs and engine lifecycle code (resume/attempt logic) handle retry/resolution semantics; protected-source response_error logic maps error statuses to typed hoster errors and the engine/test suite include retry/re-resolution scenarios. |
| ✅ | R-05 — Plugin errors remain typed and are visible in Link Grabber without mutation from the frontend. | LinkGrabber UI types were extended to carry backend errorKind/errorMessage and tests assert typed plugin errors are rendered and not overwritten by live probes; backend maps hoster errors to typed DomainError values. |
| ✅ | R-06 — Integration tests with controlled HTTP responses cover the three hosters and the unexpected-HTML case. | The PR adds extensive tests for engine/hoster interactions, plugin-level tests, and adversarial cases (disguised HTML, blank capabilities, expiry). Test files exercise HTTP mock servers and hoster resolution across MediaFire/PixelDrain/Gofile. |
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/adapters/driven/filesystem/file_storage.rs`:
- Around line 288-323: The deletion flow around the staged metadata rename and
final fs::remove_file must make staged metadata recoverable across crashes and
retries: restore or otherwise reconcile staged_meta back to the canonical
metadata before ownership checks can observe the artifact, including when
deleting staged_meta fails. Update the surrounding storage recovery/ownership
path to handle leftover staged state consistently, and add a regression test
covering a crash or retry with staged metadata so cleanup/resume remains
possible.
- Around line 71-72: The staged cleanup paths generated near TMP_COUNTER at
src-tauri/src/adapters/driven/filesystem/file_storage.rs#L71-L72 and
src-tauri/src/adapters/driven/filesystem/file_storage.rs#L286-L288 must be
collision-free across process restarts and concurrent processes. Update both
staging-path creation sites to use an atomic or filesystem-validated unique-name
mechanism before fs::rename, while preserving the existing cleanup flow.
In `@src-tauri/src/adapters/driven/network/download_engine_hoster_tests.rs`:
- Around line 84-93: Update the hoster-resolution double to return protected
sources instead of direct sources, matching production behavior and enforcing
restricted-client handling. In the fresh-source HEAD fixture, require the
Authorization header as well as in the final GET fixture, while preserving the
expired/fresh URL selection and token values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 17328a32-daa9-439f-bcf8-dcad9077e7fd
📒 Files selected for processing (23)
CHANGELOG.mdsrc-tauri/src/adapters/driven/filesystem/file_storage.rssrc-tauri/src/adapters/driven/network/download_artifact_lifecycle.rssrc-tauri/src/adapters/driven/network/download_engine.rssrc-tauri/src/adapters/driven/network/download_engine_hoster_tests.rssrc-tauri/src/adapters/driven/network/download_engine_tests.rssrc-tauri/src/adapters/driven/network/download_source_preparation.rssrc-tauri/src/adapters/driven/network/protected_source.rssrc-tauri/src/adapters/driven/network/segment_worker.rssrc-tauri/src/adapters/driven/plugin/extism_loader.rssrc-tauri/src/application/commands/hoster_download_source.rssrc-tauri/src/application/commands/premium_account_resolution.rssrc-tauri/src/application/commands/premium_account_rotation.rssrc-tauri/src/application/commands/resolve_links.rssrc-tauri/src/application/commands/resolve_links_hoster_tests.rssrc-tauri/src/application/commands/resolve_links_tests.rssrc-tauri/src/application/commands/resolve_premium_source_test_support.rssrc-tauri/src/application/commands/resolve_premium_source_tests.rssrc-tauri/src/application/commands/start_download_tests.rssrc-tauri/src/application/commands/tests_support.rssrc-tauri/src/application/services/download_source_policy.rssrc-tauri/src/domain/ports/driven/download_source_resolver.rssrc-tauri/src/domain/ports/driven/file_storage.rs
🚧 Files skipped from review as they are similar to previous changes (14)
- src-tauri/src/application/commands/premium_account_resolution.rs
- src-tauri/src/application/commands/premium_account_rotation.rs
- src-tauri/src/domain/ports/driven/file_storage.rs
- src-tauri/src/application/commands/hoster_download_source.rs
- src-tauri/src/adapters/driven/network/download_source_preparation.rs
- src-tauri/src/application/services/download_source_policy.rs
- src-tauri/src/adapters/driven/network/download_artifact_lifecycle.rs
- src-tauri/src/application/commands/resolve_premium_source_test_support.rs
- src-tauri/src/application/commands/resolve_links_tests.rs
- src-tauri/src/adapters/driven/network/protected_source.rs
- src-tauri/src/adapters/driven/plugin/extism_loader.rs
- src-tauri/src/application/commands/resolve_links.rs
- src-tauri/src/adapters/driven/network/segment_worker.rs
- src-tauri/src/adapters/driven/network/download_engine.rs
There was a problem hiding this comment.
All reported issues were addressed across 23 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Linked issue analysis
Linked issue: MAT-133: [Lot 2] Exécuter la résolution MediaFire, PixelDrain et Gofile avant téléchargement
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | R-01 — A MediaFire, PixelDrain or Gofile page URL supported is resolved by its plugin before any download. | Start/download path now classifies persisted module names and forces just-in-time hoster resolution for protected hosters; plugin extraction was expanded to multi-file extraction and hoster resolution is invoked from the application layer. |
| ✅ | R-02 — The engine downloads the resolved direct content and never the original HTML page as a false success. | Introduced protected-source response validation and engine-side checks that reject HTML/truncated responses; segment worker and engine now use SourcePolicy to avoid treating HTML pages as successful files. |
| ✅ | R-03 — The filename, size and headers provided by the plugin are preserved in the download plan. | ResolvedDownloadSource and domain/download types carry filename/size/resume metadata and request headers; IPC and Link Grabber now propagate metadata into download_start so the engine receives and uses it. |
| ✅ | R-04 — An expired direct URL is resolved again according to an explicit, tested rule. | JIT re-resolution and rotation logic for ephemeral capabilities is implemented and exercised in hoster-related engine tests and rotating resolver test scaffolding; domain errors include an explicit expired variant. |
| ✅ | R-05 — Plugin errors remain typed and are visible in Link Grabber without direct frontend mutation. | New typed hoster errors were added to DomainError; resolve_links and Link Grabber DTOs include error kinds/messages; UI tests assert typed plugin error rendering and that frontend probing does not overwrite plugin errors. |
| ✅ | R-06 — Integration tests with controlled HTTP responses cover the three hosters and the unexpected-HTML case. | Extensive test suites were added/expanded: dedicated hoster/engine tests use wiremock/controlled HTTP, plugin-specific test counts are reported for MediaFire/PixelDrain/Gofile, and adversarial HTML scenarios are covered. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/adapters/driven/network/protected_source.rs`:
- Around line 219-220: Update the doctype handling in html_prefix_decision so
only an HTML doctype returns immediately; consume non-HTML doctypes such as svg
and continue parsing the following root element. Add a regression covering an
XML declaration followed by <!doctype svg><html> to ensure it is rejected by the
protected-source check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b49345aa-e7cb-4884-b06b-cd4cefeaa025
📒 Files selected for processing (9)
CHANGELOG.mdsrc-tauri/src/adapters/driven/filesystem/file_storage.rssrc-tauri/src/adapters/driven/network/download_artifact_lifecycle.rssrc-tauri/src/adapters/driven/network/download_engine.rssrc-tauri/src/adapters/driven/network/download_engine_hoster_tests.rssrc-tauri/src/adapters/driven/network/download_engine_tests.rssrc-tauri/src/adapters/driven/network/download_source_preparation.rssrc-tauri/src/adapters/driven/network/protected_source.rssrc-tauri/src/adapters/driven/plugin/extism_loader.rs
🚧 Files skipped from review as they are similar to previous changes (6)
- CHANGELOG.md
- src-tauri/src/adapters/driven/network/download_source_preparation.rs
- src-tauri/src/adapters/driven/plugin/extism_loader.rs
- src-tauri/src/adapters/driven/network/download_engine_tests.rs
- src-tauri/src/adapters/driven/network/download_engine.rs
- src-tauri/src/adapters/driven/filesystem/file_storage.rs
There was a problem hiding this comment.
cubic analysis
All reported issues were addressed across 47 files
Linked issue analysis
Linked issue: MAT-133: [Lot 2] Exécuter la résolution MediaFire, PixelDrain et Gofile avant téléchargement
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | R-01 — A MediaFire, PixelDrain or Gofile page URL supported is resolved by its plugin before any download. | Start/download path now classifies persisted module names and forces just-in-time hoster resolution for protected hosters; plugin extraction was expanded to multi-file extraction and hoster resolution is invoked from the application layer. |
| ✅ | R-02 — The engine downloads the resolved direct content and never the original HTML page as a false success. | Introduced protected-source response validation and engine-side checks that reject HTML/truncated responses; segment worker and engine now use SourcePolicy to avoid treating HTML pages as successful files. |
| ✅ | R-03 — The filename, size and headers provided by the plugin are preserved in the download plan. | ResolvedDownloadSource and domain/download types carry filename/size/resume metadata and request headers; IPC and Link Grabber now propagate metadata into download_start so the engine receives and uses it. |
| ✅ | R-04 — An expired direct URL is resolved again according to an explicit, tested rule. | JIT re-resolution and rotation logic for ephemeral capabilities is implemented and exercised in hoster-related engine tests and rotating resolver test scaffolding; domain errors include an explicit expired variant. |
| ✅ | R-05 — Plugin errors remain typed and are visible in Link Grabber without direct frontend mutation. | New typed hoster errors were added to DomainError; resolve_links and Link Grabber DTOs include error kinds/messages; UI tests assert typed plugin error rendering and that frontend probing does not overwrite plugin errors. |
| ✅ | R-06 — Integration tests with controlled HTTP responses cover the three hosters and the unexpected-HTML case. | Extensive test suites were added/expanded: dedicated hoster/engine tests use wiremock/controlled HTTP, plugin-specific test counts are reported for MediaFire/PixelDrain/Gofile, and adversarial HTML scenarios are covered. |
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 13 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
Type
feat
Testing
Linear: MAT-133
Summary by cubic
Resolve MediaFire, PixelDrain, and Gofile pages on the backend before download, treat their direct links as protected capabilities, and keep short‑lived URLs/headers server‑only under a restricted HTTP policy. Link Grabber no longer probes hoster pages, shows typed plugin errors, and passes filename/size/resume to
download_start. MAT‑133 acceptance covered.New Features
ResolvedDownloadSourcepropagates filename/size/resume to the engine.download_start.Bug Fixes
Written for commit 96bc775. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Tests