Skip to content

beforeCreate ctx.update({ uris }) loses query strings — breaks query-param download endpoints (Google Drive etc.) #1

Description

@gricials112

Summary

On Motrix 2.0.0 (macOS arm64), when a beforeCreate hook calls
ctx.update({ uris: [...] }) with URIs that contain query strings, the
query part is stripped before the task reaches the download engine. The
engine receives only the bare path.

This breaks every resolver whose download endpoint is parameterised by
query — most importantly Google Drive:

plugin produces:
  https://drive.usercontent.google.com/download?id=<ID>&export=download&confirm=t

engine receives (from Motrix log, module "create-task"):
  "rewrittenUris":["https://drive.usercontent.google.com/download"]

The bare /download endpoint returns a small error page, so the task
silently "completes" with a junk file.

Evidence (Motrix log, 2026-08-25)

  1. Plugin contributed the full URL — orchestrator shows our hook as the
    uri contributor and then logs the already-stripped value in the same
    beforeCreate hook chain result event:
{"module":"create-task","taskId":"01a0378b-bd21-...","aborted":false,
 "rewrittenUris":["https://drive.usercontent.google.com/download"],
 "contributors":{"headers":[],"uris":"gricials112.smart-link"},
 "msg":"beforeCreate hook chain result"}
{"module":"create-task","method":"createDownload",
 "params":{"uris":["https://drive.usercontent.google.com/download"],...},
 "msg":"dispatching to engine"}
  1. Query stripping also appears to happen at ingestion: the pasted link was
    https://drive.google.com/file/d/<ID>/view?usp=drive_link, but the
    activation event logged url without ?usp=drive_link.

  2. The URL itself is healthy — fetching it directly returns HTTP 200 with
    content-disposition: attachment; filename="wallpaper2.png" (2.6 MB PNG).

Impact

  • Google Drive resolvers cannot work on 2.0.0 (both view → usercontent
    rewrites and any direct query-style links).
  • Any plugin whose resolved URI carries auth/confirmation params is affected.
  • GitHub release assets still work only because their URLs are query-free.

Expected behavior

Query strings (and ideally fragments) of hook-provided URIs must be preserved
end-to-end into the engine dispatch, exactly as passed to ctx.update().

Repro

  1. Install any site-resolver that updates uris with a query-carrying URL
    (e.g. paste a Google Drive share link with Smart Link installed), or call
    ctx.update({ uris: ['https://httpbin.org/get?a=1'] }) from a test hook.
  2. Watch create-task → dispatching to engine in the log: uris[0] arrives
    without ?a=1.

Happy to help verify a fix — we can build a targeted test package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions