feat: Experimental Matrix Support + Configuration for Native Rocket.Chat Homeserver Integration#1131
feat: Experimental Matrix Support + Configuration for Native Rocket.Chat Homeserver Integration#1131ShigrafS wants to merge 8 commits intoRocketChat:developfrom
Conversation
Previously, Matrix login failures would throw exceptions that weren't
caught by the UI error handling. Now returns error in Rocket.Chat format ({ error: 403 }) to trigger proper toast notifications.
- Add proper error returns for channelInfo/getRoomInfo for toast messages - Add try-catch to sendMessage for error handling - Add stub methods (star, pin, react, etc.) to prevent UI errors - Fix edit message to show toast instead of triggering logout - Add null-safety checks in connect() method
|
Hi @ShigrafS, Great to see work continuing on Matrix integration! Quick question : I see this PR uses The reason I ask is that when I was working on #1030, @Spiral-Memory mentioned we should use Rocket.Chat credentials and integrate with the Rocket.Chat-built homeserver rather than direct Matrix authentication (see #1030 (comment)). I'm curious how you approached this, did you find a way to use the Matrix SDK while still authenticating through Rocket.Chat? That would be really helpful to understand! |
|
Hi @Aryan-Verma-999 ! I am authenticating with Rocket.Chat credentials, not Matrix credentials. I refactored the MatrixProvider to use the The flow is:
This allows us to keep the authentication native to Rocket.Chat while still leveraging the Matrix SDK for messaging. |
Closes #1029
Description
This PR introduces experimental support for connecting EmbeddedChat directly to a Matrix homeserver, including the new Rocket.Chat native Matrix homeserver (see RocketChat/homeserver).
Key goals achieved:
This is marked experimental due to partial feature parity (many Rocket.Chat-specific features like edits, deletes, threads, pinning, reactions, search, etc., are stubbed or return "not supported" in Matrix mode). Future iterations can close the gap.
Acceptance Criteria Fulfillment
modeprop ('rocketchat'|'matrix')MatrixProviderusingmatrix-js-sdkChanges Summary
modeprop on<EmbeddedChat />(defaults to'rocketchat')mode="matrix", requireshost(Matrix homeserver URL) androomIdMatrixProviderclass implementingIChatProviderinterface (590+ lines)matrix-js-sdk@^39.3.0-rc.0for client creation, sync, room join, timeline listening, sending messages, typing@embeddedchat/authbut passes token to Matrix client)IChatProviderinterface for clean abstraction between Rocket.Chat and Matrix implementationsEmbeddedChatApibased onmodeChatInputfor Matrix mode (relies on real-time timeline events to avoid duplicates)matrix-js-sdk@^39.3.0-rc.0Limitations (Experimental Phase)
How to Test
modeprop ormode="rocketchat") → should work as before