PadMessageHandler: Improve documentation of `sessioninfos`

pull/5004/head
Richard Hansen 2021-04-12 17:32:05 -04:00
parent 4c4415e14a
commit d5c6a44d9c
1 changed files with 16 additions and 8 deletions

View File

@ -50,14 +50,22 @@ exports.socketio = () => {
}; };
/** /**
* A associative array that saves information about a session * Contains information about socket.io connections:
* key = sessionId * - key: Socket.io socket ID.
* values = padId, readonlyPadId, readonly, author, rev * - value: Object that is initially empty immediately after connect. Once the client's
* padId = the real padId of the pad * CLIENT_READY message is processed, it has the following properties:
* readonlyPadId = The readonly pad id of the pad * - auth: Object with the following properties copied from the client's CLIENT_READY message:
* readonly = Wether the client has only read access (true) or read/write access (false) * - padID: Pad ID requested by the user. Unlike the padId property described below, this
* rev = That last revision that was send to this client * may be a read-only pad ID.
* author = the author ID used for this session * - 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 = {}; const sessioninfos = {};
exports.sessioninfos = sessioninfos; exports.sessioninfos = sessioninfos;