From 04815fe9ef458706bc2c6b205839e762e67f6d8e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Apr 2026 05:55:06 +0000 Subject: [PATCH] =?UTF-8?q?Bridge:=20REQ=20=E2=80=94=20status=20route=20mi?= =?UTF-8?q?smatch,=20widget=20404s=20on=20page=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Widget calls /servers/{uuid}/status but route is /status (no uuid). useEffect hits 404, widget shows nothing until manual refresh. Option A preferred: register route with {server} param. --- .../REQ-2026-04-13-status-route-mismatch.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/code-bridge/requests/REQ-2026-04-13-status-route-mismatch.md diff --git a/docs/code-bridge/requests/REQ-2026-04-13-status-route-mismatch.md b/docs/code-bridge/requests/REQ-2026-04-13-status-route-mismatch.md new file mode 100644 index 0000000..dc5f119 --- /dev/null +++ b/docs/code-bridge/requests/REQ-2026-04-13-status-route-mismatch.md @@ -0,0 +1,51 @@ +# REQ-2026-04-13-status-route-mismatch + +**Filed by:** Chronicler #85 +**Date:** 2026-04-13 +**Priority:** HIGH — widget does not auto-load on page open +**Status:** OPEN + +## Problem + +The widget's `useEffect` fires on page load and calls: +``` +GET /api/client/extensions/modpackchecker/servers/{uuid}/status +``` + +But the registered route is: +``` +GET /api/client/extensions/modpackchecker/status +``` + +Result: `useEffect` hits a 404 on load → `catch(() => setData(null))` fires → widget shows nothing. Only the manual refresh button works because it hits `/check` (POST) which IS registered correctly. + +## Evidence + +Route list from Dev Panel: +``` +GET|HEAD api/client/extensions/modpackchecker/status ModpackAPIController@... +POST api/client/extensions/modpackchecker/servers/{server}/check ModpackAPIController@... +``` + +Widget call in `wrapper.tsx` line 46: +```js +http.get(`/api/client/extensions/modpackchecker/servers/${uuid}/status`) +``` + +## What Needs to Fix + +Either: +- **Option A:** Update the route registration to match the widget: `servers/{server}/status` +- **Option B:** Update the widget's `useEffect` to call the existing route (passing uuid as a query param) + +Option A is cleaner — keeps the route pattern consistent with `/check` and future endpoints. + +## Files Involved + +- Route registration: check `routes/` directory in blueprint extension +- Controller: `app/Http/Controllers/ModpackAPIController.php` — status method may need `$server` parameter +- Widget: `views/server/wrapper.tsx` line 46 (may not need changes if Option A) + +## After Code Pushes + +Chronicler will pull, redeploy PHP + routes to Dev Panel, verify widget auto-loads on page open.