Improve Not Found error handling#3036
Conversation
# Conflicts: # lang/en/app.php
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughBackend now returns standardized JSON 404s Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PILOS
|
||||||||||||||||||||||||||||||||||
| Project |
PILOS
|
| Branch Review |
86-improve-notfoundexceptions
|
| Run status |
|
| Run duration | 07m 38s |
| Commit |
|
| Committer | Sabrina Wüst |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
1
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
631
|
| View all changes introduced in this branch ↗︎ | |
Tests for review

e2e/RoomsJoinWithLobby.cy.js • 1 failed test • System tests
| Test | Artifacts | |
|---|---|---|
| Room Join with lobby settings > Lobby enabled for guests only |
Test Replay
Screenshots
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3036 +/- ##
=============================================
+ Coverage 96.78% 96.81% +0.02%
+ Complexity 1940 1939 -1
=============================================
Files 465 466 +1
Lines 13164 13239 +75
Branches 2145 2186 +41
=============================================
+ Hits 12741 12817 +76
+ Misses 423 422 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (4)
resources/js/views/RoomsView.vue (1)
442-448: Userouter.replace()for terminal not-found redirects.Keeping
push()here leaves the broken room URL in browser history, so Back can reopen the same missing-room redirect loop.replace()avoids that while preserving the new auth-vs-guest behavior.♻️ Proposed change
- router.push({ name: "rooms.index" }); + router.replace({ name: "rooms.index" }); ... - router.push({ name: "404" }); + router.replace({ name: "404" });Also applies to: 524-530
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@resources/js/views/RoomsView.vue` around lines 442 - 448, The 404 handling in RoomsView.vue currently uses router.push which leaves the broken room URL in history; replace router.push calls with router.replace in the error.response.status === env.HTTP_NOT_FOUND block (the branch that routes to "rooms.index" or "404") so the missing-room redirect is terminal, and make the same change for the second identical block around the other not-found handler (the other router.push at lines ~524-530) to avoid back-button loops.tests/Backend/Feature/api/v1/Room/MembershipTest.php (1)
785-791: Consider a shared assertion helper formodel_not_foundpayloads.These repeated JSON checks are consistent, but a tiny helper (e.g.,
assertModelNotFound($response, $model, $ids)) would reduce duplication and keep future contract changes centralized.Also applies to: 801-807, 848-854, 888-894
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Backend/Feature/api/v1/Room/MembershipTest.php` around lines 785 - 791, Extract the repeated JSON assertions for the "model_not_found" payload into a single test helper (e.g., assertModelNotFound($response, string $model, array $ids)) on the base TestCase (or a shared trait) and replace the inline ->assertNotFound()->assertJson([...]) chains in MembershipTest with the new helper; the helper should accept the response (or perform the status check itself), assert the 404 via assertNotFound() and assert the JSON body contains 'message' => 'model_not_found', 'model' => $model, and 'ids' => $ids so all occurrences (the deleteJson route('api.v1.rooms.member.destroy', ...) calls and similar assertions) use this centralized assertion.tests/Frontend/e2e/RoomsViewMembers.cy.js (1)
488-505: Register the 404 intercept before reload to avoid a flaky branch.
cy.reload()currently runs before the newroomMembersRequest404 intercept is installed. If the members request is triggered during reload, this scenario may miss the intended stub and become nondeterministic.🔧 Suggested stabilization
- cy.interceptRoomViewRequests(); - cy.reload(); - - // Test 404 error (room not found) - cy.interceptRoomIndexRequests(); - cy.intercept("GET", "api/v1/rooms/abc-def-123/member*", { + cy.interceptRoomViewRequests(); + cy.interceptRoomIndexRequests(); + // Test 404 error (room not found) + cy.intercept("GET", "api/v1/rooms/abc-def-123/member*", { statusCode: 404, body: { message: "model_not_found", model: "room", ids: ["abc-def-123"], }, }).as("roomMembersRequest"); + cy.reload(); + cy.wait("@roomRequest"); cy.get("#tab-members").click();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Frontend/e2e/RoomsViewMembers.cy.js` around lines 488 - 505, The 404 stub for the members request is installed after cy.reload(), making the test flaky if the members request fires during reload; move the cy.intercept("GET", "api/v1/rooms/abc-def-123/member*", { ... }).as("roomMembersRequest") call to run before cy.reload() (while keeping cy.interceptRoomViewRequests() / cy.interceptRoomIndexRequests() as needed) so the "@roomMembersRequest" stub is active during the page reload and the subsequent cy.get("#tab-members").click() step.resources/js/services/Api.js (1)
128-135: Preferreplace()for these 404 redirects.Using
push()keeps the stale room URL in history, so Back lands on the broken page and immediately redirects again.replace()avoids that loop and matches the existing unauthenticated/guests-only handlers.Suggested change
if (model === ROOM && options.redirectOnRoomModelNotFound !== false) { // Redirect to room index page if user is authenticated, otherwise show 404 page, because // unauthenticated user is not able to visit the room index page if (this.auth.isAuthenticated) { - this.router.push({ name: "rooms.index" }); + this.router.replace({ name: "rooms.index" }); } else { - this.router.push({ name: "404" }); + this.router.replace({ name: "404" }); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@resources/js/services/Api.js` around lines 128 - 135, The redirect logic that handles model === ROOM when options.redirectOnRoomModelNotFound !== false should use this.router.replace instead of this.router.push so the stale room URL is not kept in history; update the branches that check this.auth.isAuthenticated and call this.router.push({ name: "rooms.index" }) or this.router.push({ name: "404" }) to call this.router.replace(...) with the same route objects to avoid back-button redirect loops and match guest/unauthenticated handlers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lang/en/app.php`:
- Around line 69-72: The translation string for flash.model_not_found.details
contains a leading space; open the array entry for
'flash.model_not_found.details' (the 'details' key under 'model_not_found') and
remove the leading whitespace so the value reads 'Model id: :ids' instead of '
Model id: :ids' to ensure consistent UI text formatting.
In `@resources/js/components/SettingsUsersDeleteButton.vue`:
- Around line 109-114: The 404 case is being double-handled: after emitting
notFound in the catch block (when error.response.status === env.HTTP_NOT_FOUND)
the code still calls api.error(error). Modify the catch logic in the delete
flow/handler (the block using modalVisible.value, emit("notFound") and
api.error) so that once you emit("notFound") and set modalVisible.value = false
you skip calling api.error—either by returning early immediately after
emit("notFound") or by wrapping api.error(error) in an else branch that only
runs when the status is not env.HTTP_NOT_FOUND.
In `@tests/Frontend/e2e/RoomsViewDescription.cy.js`:
- Around line 466-483: The test clicks the edit button immediately after
cy.reload(), which can race with the room view request; update the test to wait
for the relevant intercepted room request to finish before reopening the editor
by awaiting the alias created by cy.interceptRoomViewRequests() or
cy.interceptRoomIndexRequests() (e.g., cy.wait('@roomRequest') or the actual
alias returned by those helpers) before calling
cy.get('[data-test="room-description-edit-button"]').click() so the reload
completes and the 404 save path is exercised reliably.
In `@tests/Frontend/e2e/RoomsViewGeneral.cy.js`:
- Line 727: Fix the typo in the inline comment that currently reads "// Check
wit 404 error (room not found) as guest" by changing "wit" to "with" so it reads
"// Check with 404 error (room not found) as guest"; this update should be made
in the RoomsViewGeneral.cy.js test comment near the guest 404 check.
In `@tests/Frontend/e2e/RoomsViewMembersBulkActions.cy.js`:
- Around line 412-422: The test races selecting members with the members grid
reload; after calling cy.interceptRoomViewRequests() and after clicking
'#tab-members' (or immediately after cy.reload()/reopening the tab), wait for
the intercepted members request alias '@roomMembersRequest' before interacting
with '[data-test="room-members-select-all-checkbox"]'; update the three
occurrences (around cy.interceptRoomViewRequests(), cy.reload(),
cy.get("#tab-members").click(), and the select-all click) to include a
cy.wait("@roomMembersRequest") so the members grid is fully loaded before
selection.
In `@tests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.js`:
- Around line 970-1001: After reloading and clicking the recordings tab you must
wait for the refreshed recordings request before opening the delete dialog to
avoid the race; after invoking cy.reload() and/or after
cy.get("#tab-recordings").click(), add a cy.wait for the recordings intercept
alias (the `@roomRecordingsRequest` created by cy.interceptRoomRecordingsRequests)
and only then proceed to find and click the delete button and confirm the dialog
so the subsequent 404 assertion targets the refreshed list.
In `@tests/Frontend/e2e/RoomsViewSettings.cy.js`:
- Around line 2372-2378: The current cy.url().should("include", "/rooms") can
match both /rooms and /rooms/abc-def-123; replace it with a stricter assertion
that the pathname is exactly the rooms index (e.g. use
cy.location('pathname').should('match', /^\/rooms\/?$/) or assert equality to
'/rooms') so the test fails if the browser is still on the room detail URL;
update the assertion that currently calls cy.url() to use
cy.location('pathname') and the regexp or exact equals check, leaving the
cy.checkToastMessage call unchanged.
- Around line 1691-1702: The PUT intercept created with cy.intercept("PUT",
"api/v1/rooms/abc-def-123", ...) is missing the alias expected by the later
cy.wait("@roomSettingsSaveRequest"); update the intercept call to attach the
alias by calling .as("roomSettingsSaveRequest") so the cy.wait can find the
request; you should modify the cy.intercept invocation in
RoomsViewSettings.cy.js to include .as("roomSettingsSaveRequest") to match the
existing cy.wait.
---
Nitpick comments:
In `@resources/js/services/Api.js`:
- Around line 128-135: The redirect logic that handles model === ROOM when
options.redirectOnRoomModelNotFound !== false should use this.router.replace
instead of this.router.push so the stale room URL is not kept in history; update
the branches that check this.auth.isAuthenticated and call this.router.push({
name: "rooms.index" }) or this.router.push({ name: "404" }) to call
this.router.replace(...) with the same route objects to avoid back-button
redirect loops and match guest/unauthenticated handlers.
In `@resources/js/views/RoomsView.vue`:
- Around line 442-448: The 404 handling in RoomsView.vue currently uses
router.push which leaves the broken room URL in history; replace router.push
calls with router.replace in the error.response.status === env.HTTP_NOT_FOUND
block (the branch that routes to "rooms.index" or "404") so the missing-room
redirect is terminal, and make the same change for the second identical block
around the other not-found handler (the other router.push at lines ~524-530) to
avoid back-button loops.
In `@tests/Backend/Feature/api/v1/Room/MembershipTest.php`:
- Around line 785-791: Extract the repeated JSON assertions for the
"model_not_found" payload into a single test helper (e.g.,
assertModelNotFound($response, string $model, array $ids)) on the base TestCase
(or a shared trait) and replace the inline ->assertNotFound()->assertJson([...])
chains in MembershipTest with the new helper; the helper should accept the
response (or perform the status check itself), assert the 404 via
assertNotFound() and assert the JSON body contains 'message' =>
'model_not_found', 'model' => $model, and 'ids' => $ids so all occurrences (the
deleteJson route('api.v1.rooms.member.destroy', ...) calls and similar
assertions) use this centralized assertion.
In `@tests/Frontend/e2e/RoomsViewMembers.cy.js`:
- Around line 488-505: The 404 stub for the members request is installed after
cy.reload(), making the test flaky if the members request fires during reload;
move the cy.intercept("GET", "api/v1/rooms/abc-def-123/member*", { ...
}).as("roomMembersRequest") call to run before cy.reload() (while keeping
cy.interceptRoomViewRequests() / cy.interceptRoomIndexRequests() as needed) so
the "@roomMembersRequest" stub is active during the page reload and the
subsequent cy.get("#tab-members").click() step.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 571f1968-c615-451e-b8a8-5e3dc5fa57af
📒 Files selected for processing (85)
app/Exceptions/Handler.phpapp/Http/Controllers/api/v1/RoomMemberController.phpapp/Http/Controllers/api/v1/RoomPersonalizedLinkController.phplang/en/app.phpresources/js/components/RoomCard.vueresources/js/components/RoomFavoriteButton.vueresources/js/components/RoomTabFilesDeleteButton.vueresources/js/components/RoomTabFilesEditButton.vueresources/js/components/RoomTabMembersDeleteButton.vueresources/js/components/RoomTabMembersEditButton.vueresources/js/components/RoomTabPersonalizedLinksDeleteButton.vueresources/js/components/RoomTabPersonalizedLinksEditButton.vueresources/js/components/RoomTabRecordingsDeleteButton.vueresources/js/components/RoomTabRecordingsEditButton.vueresources/js/components/SettingsRolesDeleteButton.vueresources/js/components/SettingsServerPoolsDeleteButton.vueresources/js/components/SettingsServersDeleteButton.vueresources/js/components/SettingsUsersDeleteButton.vueresources/js/components/SettingsUsersResetPasswordButton.vueresources/js/constants/modelNames.jsresources/js/services/Api.jsresources/js/views/AdminRolesIndex.vueresources/js/views/AdminRolesView.vueresources/js/views/AdminRoomTypesView.vueresources/js/views/AdminServerPoolsIndex.vueresources/js/views/AdminServerPoolsView.vueresources/js/views/AdminServersIndex.vueresources/js/views/AdminServersView.vueresources/js/views/AdminUsersIndex.vueresources/js/views/AdminUsersView.vueresources/js/views/RoomsView.vueroutes/api.phptests/Backend/Feature/api/v1/RecordingTest.phptests/Backend/Feature/api/v1/RoleTest.phptests/Backend/Feature/api/v1/Room/FileTest.phptests/Backend/Feature/api/v1/Room/MembershipTest.phptests/Backend/Feature/api/v1/Room/RoomDescriptionTest.phptests/Backend/Feature/api/v1/Room/RoomPersonalizedLinkTest.phptests/Backend/Feature/api/v1/Room/RoomTest.phptests/Backend/Feature/api/v1/RoomTypeTest.phptests/Backend/Feature/api/v1/ServerPoolTest.phptests/Backend/Feature/api/v1/ServerTest.phptests/Backend/Feature/api/v1/UserTest.phptests/Frontend/e2e/AdminRolesEdit.cy.jstests/Frontend/e2e/AdminRolesIndexRoleActions.cy.jstests/Frontend/e2e/AdminRolesView.cy.jstests/Frontend/e2e/AdminRolesViewRoleActions.cy.jstests/Frontend/e2e/AdminRoomTypesEdit.cy.jstests/Frontend/e2e/AdminRoomTypesIndexRoomTypeActions.cy.jstests/Frontend/e2e/AdminRoomTypesView.cy.jstests/Frontend/e2e/AdminRoomTypesViewRoomTypeActions.cy.jstests/Frontend/e2e/AdminServerPoolsEdit.cy.jstests/Frontend/e2e/AdminServerPoolsIndexServerPoolActions.cy.jstests/Frontend/e2e/AdminServerPoolsView.cy.jstests/Frontend/e2e/AdminServerPoolsViewServerPoolActions.cy.jstests/Frontend/e2e/AdminServersEdit.cy.jstests/Frontend/e2e/AdminServersIndexServerActions.cy.jstests/Frontend/e2e/AdminServersView.cy.jstests/Frontend/e2e/AdminServersViewServerActions.cy.jstests/Frontend/e2e/AdminUsersEdit.cy.jstests/Frontend/e2e/AdminUsersEditBase.cy.jstests/Frontend/e2e/AdminUsersEditEmail.cy.jstests/Frontend/e2e/AdminUsersEditOthers.cy.jstests/Frontend/e2e/AdminUsersEditSecurity.cy.jstests/Frontend/e2e/AdminUsersIndexUserActions.cy.jstests/Frontend/e2e/AdminUsersView.cy.jstests/Frontend/e2e/AdminUsersViewUserActions.cy.jstests/Frontend/e2e/RoomsIndex.cy.jstests/Frontend/e2e/RoomsViewDescription.cy.jstests/Frontend/e2e/RoomsViewFiles.cy.jstests/Frontend/e2e/RoomsViewFilesFileActions.cy.jstests/Frontend/e2e/RoomsViewGeneral.cy.jstests/Frontend/e2e/RoomsViewHistory.cy.jstests/Frontend/e2e/RoomsViewHistoryMeetingActions.cy.jstests/Frontend/e2e/RoomsViewMeetings.cy.jstests/Frontend/e2e/RoomsViewMembers.cy.jstests/Frontend/e2e/RoomsViewMembersBulkActions.cy.jstests/Frontend/e2e/RoomsViewMembersMemberActions.cy.jstests/Frontend/e2e/RoomsViewPersonalizedLinks.cy.jstests/Frontend/e2e/RoomsViewPersonalizedLinksTokenActions.cy.jstests/Frontend/e2e/RoomsViewRecordings.cy.jstests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.jstests/Frontend/e2e/RoomsViewSettings.cy.jstests/Frontend/e2e/RoomsViewStreaming.cy.jstests/Frontend/e2e/RoomsViewStreamingConfigActions.cy.js
…dexceptions # Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
🧹 Nitpick comments (4)
tests/Backend/Feature/api/v1/UserTest.php (1)
1607-1608: Optional: also assert payload shape for the disabled-local-auth 404.For consistency with the other
assertNotFound()checks in this file, consider whether this 404 (triggered by disabling local auth rather than a missing model) should also be pinned to a specific payload — or explicitly documented as distinct frommodel_not_found. Not a blocker; just avoids future ambiguity if the handler contract evolves.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Backend/Feature/api/v1/UserTest.php` around lines 1607 - 1608, The 404 assertion for the disabled-local-auth case should also validate the JSON payload shape (or specific error code) to match other assertNotFound() checks: after the existing $this->actingAs($user)->postJson(route('api.v1.users.password.reset', ['user' => $resetUser]))->assertNotFound(), chain an assertJson (or assertJsonStructure) that pins the error payload (e.g. the same keys/structure other tests use like ['message' => ..., 'errors' => ...] or the specific error code string used for disabled local auth); update the assertion on the postJson(...) call so it both assertsNotFound() and then asserts the expected JSON payload shape or error code to make the handler contract explicit.tests/Frontend/e2e/RoomsViewGeneral.cy.js (2)
3225-3243: Consider also asserting the structuredmodel_not_foundpath on reload.This test covers the legacy/raw Laravel 404 message (
"No query results for model [App\\Room]...") producing a genericapp.flash.server_errortoast on reload. Per issue#86, the backend now returns a structuredmodel_not_foundpayload for AJAX 404s, which other tests in this file exercise for other endpoints (auth/membership/favorites). For completeness/parity, consider adding a reload case that returns themodel_not_foundpayload and asserts theapp.flash.model_not_found.*toast, so both 404 shapes are covered for the reload path as well.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Frontend/e2e/RoomsViewGeneral.cy.js` around lines 3225 - 3243, Add a second reload scenario that mirrors the existing reload test but intercepts the GET to "api/v1/rooms/abc-def-123" with the structured model_not_found payload (e.g. { error: "model_not_found", model: "Room", id: "abc-def-123" } or whatever shape other tests use), then trigger the reload via cy.get('[data-test="reload-room-button"]').click(), wait for the intercepted "@roomRequest" and assert the redirect to "/404" as before, and replace or add a cy.checkToastMessage assertion that expects the localized model-not-found toast keys (e.g. 'app.flash.model_not_found.title' / 'app.flash.model_not_found.message' or the same pattern used in auth/membership/favorites tests) so both legacy and structured 404 payloads are covered for the reload path.
3068-3073: Same suggestion for the initial-visit "room not found" test.This scenario asserts only the raw-message 404 path (generic
server_errortoast + redirect). Consider adding a parallel case where the backend returns the structuredmodel_not_foundpayload, so the specializedapp.flash.model_not_found.*toast path on initial room load is exercised here too (currently only tested via auth/membership/favorites endpoints).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Frontend/e2e/RoomsViewGeneral.cy.js` around lines 3068 - 3073, Add a parallel intercept for the initial-visit "room not found" test that returns the structured model_not_found payload instead of the raw 404 body so the specialized app.flash.model_not_found.* toast path is exercised; specifically, duplicate or augment the existing cy.intercept("GET", "api/v1/rooms/abc-def-123", ...) in RoomsViewGeneral.cy.js to return a JSON body with a type or error code indicating "model_not_found" and include the model ("App\\Room") and id ("abc-def-123"); then update the test assertions to expect the model_not_found flash toast and the same redirect behavior.tests/Backend/Feature/api/v1/Room/RoomPersonalizedLinkTest.php (1)
507-560: Slight redundancy between "delete again" cases.Lines 523–530 already assert the repeated-delete 404 contract. The new block at lines 551–560 repeats the same assertion for the superuser-permission path. If the intent is to show it works across permission contexts, consider keeping it; otherwise it can be dropped to reduce noise. Not blocking.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Backend/Feature/api/v1/Room/RoomPersonalizedLinkTest.php` around lines 507 - 560, In RoomPersonalizedLinkTest remove the redundant "Test delete again" block that repeats the same assertNotFound/assertJson after the superuser delete; specifically delete the final deleteJson(...) ->assertNotFound() ->assertJson(...) sequence (the repeated call to route('api.v1.rooms.personalizedLinks.destroy', ['room' => $this->room, 'personalizedLink' => $link])) since the repeated-delete 404 is already asserted earlier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/Backend/Feature/api/v1/Room/RoomPersonalizedLinkTest.php`:
- Around line 507-560: In RoomPersonalizedLinkTest remove the redundant "Test
delete again" block that repeats the same assertNotFound/assertJson after the
superuser delete; specifically delete the final deleteJson(...)
->assertNotFound() ->assertJson(...) sequence (the repeated call to
route('api.v1.rooms.personalizedLinks.destroy', ['room' => $this->room,
'personalizedLink' => $link])) since the repeated-delete 404 is already asserted
earlier.
In `@tests/Backend/Feature/api/v1/UserTest.php`:
- Around line 1607-1608: The 404 assertion for the disabled-local-auth case
should also validate the JSON payload shape (or specific error code) to match
other assertNotFound() checks: after the existing
$this->actingAs($user)->postJson(route('api.v1.users.password.reset', ['user' =>
$resetUser]))->assertNotFound(), chain an assertJson (or assertJsonStructure)
that pins the error payload (e.g. the same keys/structure other tests use like
['message' => ..., 'errors' => ...] or the specific error code string used for
disabled local auth); update the assertion on the postJson(...) call so it both
assertsNotFound() and then asserts the expected JSON payload shape or error code
to make the handler contract explicit.
In `@tests/Frontend/e2e/RoomsViewGeneral.cy.js`:
- Around line 3225-3243: Add a second reload scenario that mirrors the existing
reload test but intercepts the GET to "api/v1/rooms/abc-def-123" with the
structured model_not_found payload (e.g. { error: "model_not_found", model:
"Room", id: "abc-def-123" } or whatever shape other tests use), then trigger the
reload via cy.get('[data-test="reload-room-button"]').click(), wait for the
intercepted "@roomRequest" and assert the redirect to "/404" as before, and
replace or add a cy.checkToastMessage assertion that expects the localized
model-not-found toast keys (e.g. 'app.flash.model_not_found.title' /
'app.flash.model_not_found.message' or the same pattern used in
auth/membership/favorites tests) so both legacy and structured 404 payloads are
covered for the reload path.
- Around line 3068-3073: Add a parallel intercept for the initial-visit "room
not found" test that returns the structured model_not_found payload instead of
the raw 404 body so the specialized app.flash.model_not_found.* toast path is
exercised; specifically, duplicate or augment the existing cy.intercept("GET",
"api/v1/rooms/abc-def-123", ...) in RoomsViewGeneral.cy.js to return a JSON body
with a type or error code indicating "model_not_found" and include the model
("App\\Room") and id ("abc-def-123"); then update the test assertions to expect
the model_not_found flash toast and the same redirect behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b296c303-bdfe-4dd2-b104-59e6fa9a5c6f
📒 Files selected for processing (21)
CHANGELOG.mdapp/Http/Controllers/api/v1/RoomMemberController.phpapp/Http/Controllers/api/v1/RoomPersonalizedLinkController.phplang/en/app.phpresources/js/views/AdminServersIndex.vueresources/js/views/RoomsView.vuetests/Backend/Feature/api/v1/RecordingTest.phptests/Backend/Feature/api/v1/RoleTest.phptests/Backend/Feature/api/v1/Room/FileTest.phptests/Backend/Feature/api/v1/Room/MembershipTest.phptests/Backend/Feature/api/v1/Room/RoomPersonalizedLinkTest.phptests/Backend/Feature/api/v1/ServerPoolTest.phptests/Backend/Feature/api/v1/ServerTest.phptests/Backend/Feature/api/v1/UserTest.phptests/Frontend/e2e/AdminServersIndexServerActions.cy.jstests/Frontend/e2e/RoomsViewFiles.cy.jstests/Frontend/e2e/RoomsViewFilesFileActions.cy.jstests/Frontend/e2e/RoomsViewGeneral.cy.jstests/Frontend/e2e/RoomsViewMeetings.cy.jstests/Frontend/e2e/RoomsViewRecordings.cy.jstests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.js
✅ Files skipped from review due to trivial changes (3)
- CHANGELOG.md
- tests/Frontend/e2e/RoomsViewRecordings.cy.js
- tests/Backend/Feature/api/v1/Room/FileTest.php
🚧 Files skipped from review as they are similar to previous changes (13)
- resources/js/views/AdminServersIndex.vue
- tests/Backend/Feature/api/v1/RoleTest.php
- tests/Backend/Feature/api/v1/ServerTest.php
- lang/en/app.php
- resources/js/views/RoomsView.vue
- tests/Frontend/e2e/RoomsViewFiles.cy.js
- tests/Backend/Feature/api/v1/RecordingTest.php
- tests/Frontend/e2e/AdminServersIndexServerActions.cy.js
- tests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.js
- tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js
- tests/Frontend/e2e/RoomsViewMeetings.cy.js
- app/Http/Controllers/api/v1/RoomPersonalizedLinkController.php
- tests/Backend/Feature/api/v1/Room/MembershipTest.php
Co-authored-by: Samuel Weirich <4281791+samuelwei@users.noreply.github.com>
…dexceptions # Conflicts: # CHANGELOG.md
Fixes #86
Fixes #1676
Type
Checklist
Changes
Other information
Summary by CodeRabbit
New Features
Bug Fixes
Improvements