fix: interop forward built a double slash, so the product never registered - #181
Draft
benjamsf wants to merge 1 commit into
Draft
fix: interop forward built a double slash, so the product never registered#181benjamsf wants to merge 1 commit into
benjamsf wants to merge 1 commit into
Conversation
…tered
POST /api/v1/product/interop/{tgt} answered 200 while the target product never
saw the request. In a real deployment that left BattleLog permanently
unregistered with matrixrmapi: every /interop/authz came back 403, and the
product's room list, invite acceptance and Space search all failed with it.
views.py passed "/api/v1/interop/add" — a LEADING slash — into
post_to_product, and _method_to_product joins it as
f"{productconf['api']}{url_suffix}". Every manifest "api" value ends in "/"
(miniwerk manifests.py), so the result was
https://matrix.<domain>:4626//api/v1/interop/add
yarl preserves the doubled slash and Starlette does not route it. Verified
directly: yarl 1.24.5 keeps the path as "//api/v1/interop/add", and a mounted
FastAPI app answers 200 for the single-slash path and 404 for the doubled one.
raise_for_status then turns that 404 into an aiohttp.ClientError, which
_method_to_product swallows into None, and add_interop maps None to
HTTP 200 with success:false — so the caller is told nothing useful.
That call site was the only one in the codebase with a leading slash; every
other product call (descriptions, instructions, user CRUD, healthcheck) passes
a relative suffix, which is exactly why interop alone failed while everything
else worked over the same nginx, port and client certificate.
Two changes: the suffix is now relative like all the others, and the join
normalises both sides so no future caller can reintroduce it. The second is
behaviour-preserving for the existing relative call sites.
benjamsf
added a commit
to pvarki/docker-rasenmaeher-integration
that referenced
this pull request
Aug 29, 2026
Production confirmed the diagnosis from its own logs:
Failure to call https://matrix.<domain>:4626//api/v1/interop/add:
ClientResponseError(... status=404 ...) productapihelpers.py:142
The doubled slash, a 404 from nginx, every five seconds. RM then turns that
into HTTP 200 with success:false, so BattleLog was told interop had been
granted while matrixrmapi had never heard of it — and answered every
/interop/authz with 403. The room list, invite acceptance and Space search all
failed with it.
pvarki/python-rasenmaeher-api#181 fixes the join. Until it merges and a release
tag exists, this pins the branch tag so a test server can actually run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User-Facing Summary
POST /api/v1/product/interop/{tgt}answered 200 while the target product never received the request, so a product could never be registered for interop with another. In a live deployment BattleLog stayed permanently unregistered withmatrixrmapi: every/interop/authzreturned 403, and the room list, invite acceptance and Space search all failed with it.views.pypassed"/api/v1/interop/add"— a leading slash — and_method_to_productjoins it asf"{productconf['api']}{url_suffix}". Every manifestapivalue ends in/, so the request went tohttps://matrix.<domain>:4626//api/v1/interop/add. yarl preserves the doubled slash and Starlette does not route it, so the product 404s.aiohttp.ClientError, which_method_to_productswallows intoNone, andadd_interopmapsNoneto HTTP 200 withsuccess: false— so the caller is told nothing useful.Why It's Good for the Product (Release Goal)
Verified
yarl1.24.5 keeps the path as//api/v1/interop/addrather than collapsing it./api/v1/interop/addand 404 for//api/v1/interop/add.