How to detect when CKEditor real time collaboration module creates a new session?

Discussão em 'Angular' iniciado por Pavlo Krasota, Março 7, 2025.

  1. I am working with CKEditor RTC (Real-Time Collaboration) and need to reliably detect when a new session is created after canceling all previous sessions.

    Current Flow:

    • The user has an active RTC session.
    • I cancel all sessions via an HTTP request.
    • The backend informs the frontend that the session was canceled, and the user can use the editor again.
    • The frontend tries to interact with the editor (e.g., pasting content or disabling read-only mode). However, the editor has not yet created a new session, so these actions fail.

    Right now, I have to use a timeout to wait for the new session to be established before proceeding, which is unreliable.

    Is there an event or callback in CKEditor RTC that I can use to detect when a new session is successfully created, so I can execute my logic with 100% certainty instead of relying on timeouts?

    I tried using the Sessions class and listening to the event: sessionAdd:channelId(eventInfo, { channelId, session }) But this event doesn’t help because it always indicates that the session is not yet created with the user. I also tried manually calling session.init(), but it throws an error saying that a session already exists for this user.

    Continue reading...

Compartilhe esta Página