Skip to content

feat: Live Chat with event polling for real-time#13

Merged
mpge merged 3 commits into
mainfrom
feat/live-chat
Apr 8, 2026
Merged

feat: Live Chat with event polling for real-time#13
mpge merged 3 commits into
mainfrom
feat/live-chat

Conversation

@mpge

@mpge mpge commented Apr 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add ChatSession and ChatRoutingRule models with custom DB tables (via dbDelta)
  • Add ChatSessionService and ChatRoutingService
  • Add Chat_Controller (agent REST API) and Widget_Chat_Controller (public widget API)
  • Add polling endpoint (/poll) for real-time updates since WordPress lacks WebSocket
  • Add Chat_Cleanup WP-Cron task for idle session cleanup
  • Register controllers in Api_Bootstrap and cron in Activator
  • Add PHPUnit tests for the full session lifecycle

Test plan

  • Run PHPUnit and verify Test_Chat_Session_Service passes
  • Confirm widget can start chat via POST /escalated/v1/widget/chat/start
  • Confirm agent can accept and exchange messages via REST
  • Verify polling endpoint returns new messages
  • Verify WP-Cron cleans up idle sessions

mpge added 3 commits April 8, 2026 16:10
Introduce ChatSession and ChatRoutingRule custom tables, services,
REST API controllers for agents and the widget, a polling endpoint
for real-time updates, WP-Cron cleanup for idle sessions, and PHPUnit
tests for the session lifecycle.
@mpge
mpge merged commit 2c09f65 into main Apr 8, 2026
3 checks passed
@mpge
mpge deleted the feat/live-chat branch April 8, 2026 20:28
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