Skip to content

fix: show "not found" for deleted servers, nodes and users - #175

Merged
ericwang401 merged 3 commits into
4.xfrom
fix/not-found-pages
Oct 16, 2026
Merged

ericwang401 merged 3 commits into
4.xfrom
fix/not-found-pages

Conversation

@ericwang401

Copy link
Copy Markdown
Collaborator

Opening a server that had been deleted showed "Something went wrong" with Laravel's No query results for model [Convoy\Models\Server]. Deleted nodes and users in the admin area broke the page outright.

Changes

  • API: a missing route-bound record now answers JSON requests with "This server could not be found. It may have been deleted." The wording follows the model's name, so nodes, users and other records get the same message. This is a renderable on NotFoundHttpException; by that point Laravel has already converted the ModelNotFoundException.
  • Server pages (client and admin): a 404 shows the existing NotFound screen ("Server not found", with Go Back to the server list). Other errors still use the generic error screen, now with a readable message.
  • Admin node and user pages: their loaders used to swallow errors and return null, and the routers then read node.name / user.name and crashed. The loaders now return a LoadFailure, which the routers render as "Node not found" / "User not found" (or the real error) before touching the record.

Testing

  • Pest: the API message for a missing server (client) and a missing node (admin).
  • Playwright: opens a missing server (client and admin), node and user, and expects the not-found screen. All four fail on the old code.

Opening a server that had been deleted showed "Something went wrong" with
Laravel's "No query results for model [Convoy\Models\Server]": the
backend sent that message as the 404's body and the server routers put
any error's message on a generic error screen. Admin node and user pages
were worse: their loaders swallowed the error and returned null, and the
routers then read node.name / user.name and broke.

Backend: a renderable on NotFoundHttpException (Laravel has converted the
ModelNotFoundException by then) answers JSON requests with "This <model>
could not be found. It may have been deleted."

Frontend: a 404 now shows the existing NotFound screen -- "Server not
found" / "Node not found" / "User not found" -- with Go Back to the list.
Server routers check isNotFoundError() on the fetch; the node and user
loaders return a LoadFailure instead of null, which their routers render
through LoadFailureScreen before touching the record. Other errors still
use the generic error screen, now with a readable message.

Tested with Pest (the API message for a missing server and node) and a
Playwright spec opening a missing server (client and admin), node and
user; all four fail on the old code.
NotFound didn't pass ScreenBlock's center, so inside a page it sat at the left edge, unlike the other status screens. The full-page 404 is centred by its own layout and looks the same.
# Conflicts:
#	CHANGELOG.md
@ericwang401
ericwang401 merged commit 4d93d92 into 4.x Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant