Richard Hansen
caefd2184a
PadMessageHandler: Don't fire userLeave
if user hasn't joined yet
2021-11-07 01:30:39 -04:00
Richard Hansen
56cb08f4c5
pad: Pass color and display name in CLIENT_READY
2021-11-05 18:14:27 -04:00
Richard Hansen
fe87e2df87
ImportHandler: Pass the pad ID to the import
hook
...
This enables plugins to log the pad ID if desired.
2021-11-05 17:19:54 -04:00
Richard Hansen
caf4e9f28c
ImportHandler: Use truthiness to signal conversion handled
2021-11-05 17:19:54 -04:00
Richard Hansen
26675c5019
chat: New chatNewMessage
server-side hook
2021-11-01 01:54:29 -04:00
Richard Hansen
4c2f7f9a11
chat: Rename userId
to authorId
, userName
to displayName
2021-11-01 01:54:28 -04:00
Richard Hansen
0f47ca9046
chat: Plumb message object end to end
...
This will make it possible for future commits to add hooks that allow
plugins to augment chat messages with arbitrary metadata.
2021-11-01 01:54:28 -04:00
Richard Hansen
9aaf781548
PadMessageHandler: Modernize userLeave
hook context properties
2021-10-30 03:07:44 -04:00
Richard Hansen
a6d060d67b
PadMessageHandler: Replace clientReady
hook with new userJoin
hook
2021-10-30 03:07:44 -04:00
Richard Hansen
c98910e1c5
PadMessageHandler: Populate session info as early as possible
2021-10-30 03:07:44 -04:00
Richard Hansen
b7de24c85f
PadMessageHandler: Fix readability of duplicate user check
2021-10-30 03:07:44 -04:00
Richard Hansen
00e7b04518
PadMessageHandler: Improve readability of changeset loading
2021-10-30 03:07:44 -04:00
Richard Hansen
50b9e0df1f
PadMessageHandler: Use values from session info object
...
This is more consistent with the rest of the code, and it provides a
single source of truth.
2021-10-30 03:07:40 -04:00
Richard Hansen
10e930408c
PadMessageHandler: Delete unnecessary CLIENT_READY checks
...
The checks are already performed by the security manager.
2021-10-30 03:06:57 -04:00
Richard Hansen
0992f19570
PadMessageHandler: Improve readability of historical author fetch
2021-10-30 03:06:57 -04:00
Richard Hansen
d36a37d666
PadMessageHandler: Delete unnecessary protocolVersion
...
We can assume that the client code is always in sync with what the
server expects.
2021-10-30 03:06:57 -04:00
Richard Hansen
ce730b0493
PadMessageHandler: Inline createSessionInfoAuth()
...
This function is only used once so it doesn't need to be separate.
2021-10-30 03:06:57 -04:00
Richard Hansen
fa54dc1053
PadMessageHandler: Run the clientReady
hook asynchronously
2021-10-30 03:06:57 -04:00
Richard Hansen
5d30e0b1b2
PadMessageHandler: Run the userLeave
hook asynchronously
2021-10-30 03:06:57 -04:00
Richard Hansen
f2a118b311
PadMessageHandler: Inline unnecessary variables
...
Also delete some unneccessary comments.
2021-10-30 03:06:15 -04:00
Richard Hansen
7522d76c40
PadMessageHandler: Invert condition to improve readability
2021-10-30 03:03:19 -04:00
Richard Hansen
a3b4d985ac
lint: Fix awkward string formatting
2021-10-30 03:03:19 -04:00
Richard Hansen
5cbbcbcee6
pad: Simplify reload after .etherpad
import
...
The old "switch to pad" logic looked buggy, and it complicates pad
initialization. Forcing a refresh after importing an `.etherpad` file
isn't much of a UX downgrade.
2021-10-29 19:27:33 -04:00
Richard Hansen
d8cbd134d3
PadMessageHandler: Improve readability
2021-10-07 19:53:40 -04:00
Richard Hansen
044f6543a5
lint: Fix ESLint errors (mostly camelcase warnings)
2021-10-07 19:53:40 -04:00
webzwo0i
dbd76f0c5d
export: Don't leak writeable pad ID when exporting
...
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-09-15 18:32:06 -04:00
Richard Hansen
bc9cdd6957
SocketIORouter: Add acknowledgement support
2021-09-06 14:45:26 -04:00
Richard Hansen
9f9adb369b
SocketIORouter: Don't crash if message handler throws
2021-09-06 14:45:26 -04:00
Richard Hansen
94f71bd5e9
SocketIORouter: Add ability to unregister handler
...
This will make it easier to add tests.
2021-09-06 14:45:26 -04:00
Richard Hansen
2e93fca699
SocketIORouter: Logging improvements
2021-09-06 14:45:26 -04:00
Richard Hansen
b9609a749d
SocketIORouter: Rename variables to improve readability
2021-09-06 14:45:26 -04:00
Richard Hansen
c83bb058d1
PadMessageHandler: Fix stats null dereference
...
It is possible for the stats to be read before the
`expressCreateServer` hook is called (in particular: when there is an
error during startup), which is when the `socketio` variable is set.
Check for non-null `socketio` before attempting to count the number of
socket.io connections.
2021-07-22 13:07:03 -04:00
Richard Hansen
53cca5a743
PadMessageHandler: Also send USER_NEWINFO
messages on reconnect
...
Now the user list is correct after a reconnect. This also allows
ep_webrtc to automatically recover after a temporary network glitch.
2021-06-16 01:35:25 -04:00
Richard Hansen
b040ebf419
Revert "PadMessageHandler: Use a Map
for sessioninfos
"
...
Switching to a Map broke ep_webrtc and maybe other plugins.
This reverts commit eeead46437
.
2021-05-05 18:09:10 -04:00
Richard Hansen
eeead46437
PadMessageHandler: Use a Map
for sessioninfos
...
Maps are a bit more flexible, have clearer semantics, and have a
convenient `size` property.
2021-05-03 01:35:11 -04:00
Richard Hansen
14d4aadfe4
PadMessageHandler: Parallelize client updates
...
Multiple clients are updated in parallel, but multiple revisions sent
to a particular client are still sent sequentially.
2021-05-03 01:35:11 -04:00
Richard Hansen
770755debf
PadMessageHandler: Assume sessioninfo stays valid during client update
...
...but add a try/catch around the message transmission just in case.
2021-05-03 01:35:11 -04:00
Richard Hansen
c85391862b
PadMessageHandler: Avoid unnecessary property lookups
2021-05-03 01:35:11 -04:00
Richard Hansen
d5c6a44d9c
PadMessageHandler: Improve documentation of sessioninfos
2021-05-03 01:35:11 -04:00
Richard Hansen
4c4415e14a
PadMessageHandler: Register activePads
metric only once
2021-05-03 01:35:11 -04:00
pcworld
3c71e8983b
Fix read only pad access with authentication
...
Before this commit, webaccess.checkAccess saved the authorization in
user.padAuthorizations[padId] with padId being the read-only pad ID,
however later stages, e.g. in PadMessageHandler, use the real pad ID for
access checks. This led to authorization being denied.
This commit fixes it by only storing and comparing the real pad IDs and
not read-only pad IDs.
This fixes test case "authn user readonly pad -> 200, ok" in
src/tests/backend/specs/socketio.js.
2021-04-12 22:51:06 -04:00
Richard Hansen
1ad134a538
PadMessageHandler: Improve logging of pre-CLIENT_READY drops
...
This should make it easier to see what is emitting the the messages so
it can be fixed.
2021-04-09 18:43:02 +02:00
Richard Hansen
b2c0837cf5
import/export: Promisify Abiword and LibreOffice conversion
2021-03-18 09:02:28 +00:00
Richard Hansen
83f39289aa
import/export: On export error return 500 instead of crashing
2021-03-18 09:02:28 +00:00
Richard Hansen
3a11e97758
import/export: Spelling fix: "convertor" -> "converter"
2021-03-18 09:02:28 +00:00
Richard Hansen
50fdadab7d
ExportHandler: Pass the error unmodified
2021-03-18 09:02:28 +00:00
Richard Hansen
216aecd433
import/export: Use Error objects for errors, not strings
2021-03-18 09:02:28 +00:00
Richard Hansen
59c167e31b
ExportHandler: Replace unnecessary exception with return
2021-03-18 09:02:28 +00:00
Richard Hansen
b6c2586920
import/export: Delete unnecessary comments
2021-03-18 09:02:28 +00:00
Richard Hansen
392d9dcfde
PadMessageHandler: Fix fetching of socket.io Sockets for a pad
2021-02-27 08:46:49 +00:00