From d5c6a44d9cd1a343742b811f95a6ade2397b287d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 12 Apr 2021 17:32:05 -0400 Subject: [PATCH] PadMessageHandler: Improve documentation of `sessioninfos` --- src/node/handler/PadMessageHandler.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index a10b1167c..89896fa71 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -50,14 +50,22 @@ exports.socketio = () => { }; /** - * A associative array that saves information about a session - * key = sessionId - * values = padId, readonlyPadId, readonly, author, rev - * padId = the real padId of the pad - * readonlyPadId = The readonly pad id of the pad - * readonly = Wether the client has only read access (true) or read/write access (false) - * rev = That last revision that was send to this client - * author = the author ID used for this session + * Contains information about socket.io connections: + * - key: Socket.io socket ID. + * - value: Object that is initially empty immediately after connect. Once the client's + * CLIENT_READY message is processed, it has the following properties: + * - auth: Object with the following properties copied from the client's CLIENT_READY message: + * - padID: Pad ID requested by the user. Unlike the padId property described below, this + * may be a read-only pad ID. + * - sessionID: Copied from the client's sessionID cookie, which should be the value + * returned from the createSession() HTTP API. This will be null/undefined if + * createSession() isn't used or the portal doesn't set the sessionID cookie. + * - token: User-supplied token. + * - author: The user's author ID. + * - padId: The real (not read-only) ID of the pad. + * - readonlyPadId: The read-only ID of the pad. + * - readonly: Whether the client has read-only access (true) or read/write access (false). + * - rev: The last revision that was sent to the client. */ const sessioninfos = {}; exports.sessioninfos = sessioninfos;