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
7dbd278d1d
deps: Bump js-cookie to 3.0.0
2021-08-29 23:36:48 -04:00
Richard Hansen
118c66e5d0
HTML import: Improve log message for invalid HTML
2021-08-12 13:53:23 -04:00
Richard Hansen
c816c20bc7
HTML import: Replace cheerio with jsdom to simplify contentcollector
...
Cheerio provides jQuery-like objects but they wrap DOM Node-like
objects that are not 100% API compatible with the DOM spec. Because of
this, contentcollector, which is used in browsers and in Node.js
during HTML import, has until now needed to support two different
APIs. This commit modifies HTML import to use jsdom instead of cheerio
and simplifies contentcollector.
2021-08-12 13:53:23 -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
ef1ba21104
deps: Drop support for Node.js < 12.13.0
2021-06-14 23:17:17 +02:00
Richard Hansen
6c2f31a5cb
tests: Add tests for settings.json
parsing
2021-06-06 14:00:52 -04:00
Richard Hansen
428f8d1684
Settings: Deprecate null as the default default value
2021-06-06 14:00:52 -04:00
Richard Hansen
c7bb18c6da
Settings: Support null and undefined env var substitutions
2021-06-06 14:00:51 -04:00
Richard Hansen
45ca82fd9f
tests: Make the Mocha results area resizable
2021-06-05 03:51:55 -04:00
Richard Hansen
d9782ac628
tests: Send frontend test spec list as JSON
2021-06-05 03:51:06 -04:00
Richard Hansen
c714ff1014
tests: Let Express handle errors when serving frontendTestSpecs.js
...
Express v4.x doesn't understand Promises so we have to manually catch
Promise rejections and pass the error object to `next()`.
2021-06-05 03:50:36 -04:00
Richard Hansen
e4f011df76
tests: Use require()
to load frontend test specs
...
This makes core and plugin tests consistent with each other, makes it
possible to `require()` relative paths in spec files, simplifies the
code somewhat, and should make it easier to move away from
require-kernel.
Also:
* Wrap plugin tests inside a `describe()` that contains the plugin
name to make it easier to grep for a plugin's tests and for
consistency with core tests.
* Add "<core>" to the core test descriptions to make it easier to
distinguish them from plugin tests.
2021-06-05 03:50:26 -04:00
Richard Hansen
d8eb79428f
tests: Recurse under frontend spec dir
2021-06-05 03:49:13 -04:00
Richard Hansen
5d54c1657a
tests: Redirect /tests/frontend/index.html
to /tests/frontend/
2021-06-05 03:49:12 -04:00
Richard Hansen
712b8c5769
tests: Redirect /tests/frontend
to /tests/frontend/
2021-06-05 03:49:12 -04:00
Richard Hansen
573da027e5
tests: Preserve query string when redirecting
2021-06-05 03:49:12 -04:00
Richard Hansen
dfd649dbe9
tests: Use a relative redirect for /tests/frontend
...
This avoids problems if Etherpad is served under a path like
`/etherpad`.
2021-06-03 15:10:23 -04:00
Richard Hansen
617267ce71
tests: Use plugin_defs
to get plugin frontend test spec paths
2021-06-03 15:10:23 -04:00
Richard Hansen
1b7b96f57e
tests: Avoid deprecated fs.existsSync()
2021-06-03 15:10:23 -04:00
Richard Hansen
ab824c728f
tests: Move slashes to improve readability
2021-06-03 15:10:22 -04:00
Richard Hansen
1516bf473f
tests: Delete unnecessary staticDir
variable
2021-06-03 15:10:22 -04:00
Richard Hansen
d69345bb4e
tests: Use map+reduce to improve readability
2021-06-03 15:10:22 -04:00
Richard Hansen
a8e77126e8
tests: Combine .map().filter().map()
into single .map()
2021-06-03 15:10:22 -04:00
Richard Hansen
2414203434
tests: Remove unnecessary return
2021-06-03 15:10:22 -04:00
Richard Hansen
0852df74f1
tests: Unexport unnecessarily exported functions
2021-06-03 15:10:22 -04:00
Richard Hansen
ed44449639
tests: Pretty-print frontendTestSpecs.js
to make troubleshooting easier
2021-06-03 15:10:22 -04:00
Richard Hansen
4fa9f9e9d8
tests: Use window.foo
instead of var foo
2021-06-03 15:10:22 -04:00
Richard Hansen
aea2fb7448
tests: Rename specs_list
to frontendTestSpecs
2021-06-03 15:10:22 -04:00
Richard Hansen
b85a040f13
tests: Reuse sanitizePathname
when serving frontend specs
2021-06-03 15:10:22 -04:00
Richard Hansen
ade17490e0
tests: Combine frontend test file handlers
2021-06-03 15:10:22 -04:00
Richard Hansen
995e381243
tests: Only wrap *.js
files in describe()
2021-06-03 15:10:22 -04:00
Richard Hansen
e1c2c963f0
tests: URL decode test spec pathnames
...
Express automatically URL decodes route parameters.
2021-06-03 15:10:22 -04:00
Richard Hansen
998e77ec25
tests: Switch to promisified readFile
2021-06-03 15:10:22 -04:00
Richard Hansen
6cf27a7133
tests: Use fs.promises
instead of wrapping with util.promisify
2021-06-03 15:10:22 -04:00
Richard Hansen
f00f9aa14c
tests: Avoid .then()
inside async
functions
2021-06-03 15:10:22 -04:00
Richard Hansen
d87b4e0c20
tests: Use async
/await
instead of returning Promises
...
This makes stack traces more useful.
2021-06-03 15:10:21 -04:00
Richard Hansen
0d9476529e
sanitizePathname: Move to separate module to facilitate reuse
2021-06-03 15:10:21 -04:00
Richard Hansen
926da57e34
Minify: Refine sanitizePathname
to avoid pathname traversal
2021-06-03 15:10:21 -04:00
Richard Hansen
6f2f20233f
lint: Fix straightforward ESLint errors
2021-05-12 11:26:35 +02:00
Richard Hansen
59c03bde20
lint: Re-run eslint --fix
2021-05-12 11:26:35 +02: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