Bridge: REQ — status route mismatch, widget 404s on page load

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.
This commit is contained in:
Claude
2026-04-13 05:55:06 +00:00
parent 03d7f87aff
commit 04815fe9ef

View File

@@ -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.