Repository navigation
Serve escalated.admin.chat.end from the agent UI session - #145
Merged
Merged
Conversation
The shared TicketShow posts End Chat to route('escalated.admin.chat.end',
chat_session_id). The only end-chat endpoint was on the stateless
/escalated/api chain, which ignores the browser session, so the name did
not resolve and the page could not end a chat. Add POST
/escalated/agent/chat/{session}/end behind the agent gate and CSRF, 422
when already ended as escalated-laravel.
This was referenced Oct 23, 2026
Merged
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.
End Chat on the agent ticket page (shared frontend PR #215) posts
{}toroute('escalated.admin.chat.end', chat_session_id)with the agent's browser session andX-CSRF-TOKEN.POST /escalated/api/agent/chat/{sessionId}/end, is on the stateless token-auth API chain, which ignores the session cookie (verified by a test: a session-authenticated POST there is refused).POST /escalated/agent/chat/{session}/endonAgentUiController(agent gate, web chain CSRF,escalated.ui.enabled), reading no body: 200{message:'Chat ended.'}, 422{message:'Chat is already ended.'}like escalated-laravel, 404 for an unknown session.escalated.admin.chat.end->/agent/chat/{session}/endinUiRoutes.Tests:
AgentChatEndUiTestthrough MockMvc with a session-stored security context and CSRF header: name resolves, ends the chat, 422, 404, no CSRF -> 403, non-agent -> 403, API endpoint refuses the browser session but still works for API callers. Full suite + checkstyle green locally on H2, PostgreSQL 17 and MySQL 8.4.