fix(starlette): Stop duplicating scope["root_path"] in URLs#6579
2 issues
code-review: Found 2 issues (1 medium, 1 low)
Medium
Sentry monitoring silently disabled for all Quart requests when version is undetectable - `sentry_sdk/integrations/quart.py:94-98`
When package_version("quart") returns None, every request bypasses SentryAsgiMiddleware entirely with no warning or error, leaving the app completely unmonitored. Consider raising DidNotEnable at setup time (like starlette.py does) or falling back to a safe default for path_includes_root_path.
Low
test_request_url doesn't set root_path, so it doesn't validate the root_path deduplication fix - `tests/integrations/fastapi/test_fastapi.py:1050-1093`
The test uses the default empty root_path, so both the old (broken) and new code produce the same URL ("" + "/root/nomessage" = "/root/nomessage"). Consider passing root_path="/root" to TestClient and asserting the URL is http://testserver/root/nomessage, not http://testserver/root/root/nomessage. The Django ASGI test correctly does this with comm.scope["root_path"] = "/root".
Also found at:
tests/integrations/starlette/test_starlette.py:1507-1525tests/integrations/quart/test_quart.py:703-707
⏱ 7m 4s · 2.7M in / 111.0k out · $3.89
Annotations
Check warning on line 98 in sentry_sdk/integrations/quart.py
sentry-warden / warden: code-review
Sentry monitoring silently disabled for all Quart requests when version is undetectable
When `package_version("quart")` returns `None`, every request bypasses `SentryAsgiMiddleware` entirely with no warning or error, leaving the app completely unmonitored. Consider raising `DidNotEnable` at setup time (like `starlette.py` does) or falling back to a safe default for `path_includes_root_path`.