Commit graph

422 commits

Author SHA1 Message Date
decaffeinate
30a9c6ed2c decaffeinate: Rename ApplyUpdateTests.coffee and 18 other files from .coffee to .js 2020-06-23 18:30:23 +01:00
decaffeinate
3eceb8a5f6 prettier: convert test/unit decaffeinated files to Prettier format 2020-06-23 18:30:16 +01:00
decaffeinate
68e2adebf5 decaffeinate: rename test/unit/coffee to test/unit/js 2020-06-23 18:30:06 +01:00
decaffeinate
93697a8c5c decaffeinate: Run post-processing cleanups on AuthorizationManagerTests.coffee and 13 other files 2020-06-23 18:30:03 +01:00
decaffeinate
2ca620e7a0 decaffeinate: Convert AuthorizationManagerTests.coffee and 13 other files to JS 2020-06-23 18:29:59 +01:00
decaffeinate
e5d07bd3af decaffeinate: Rename AuthorizationManagerTests.coffee and 13 other files from .coffee to .js 2020-06-23 18:29:53 +01:00
decaffeinate
817844515d prettier: convert app/js decaffeinated files to Prettier format 2020-06-23 18:29:44 +01:00
decaffeinate
04a85a6716 decaffeinate: rename app/coffee dir to app/js 2020-06-23 18:29:41 +01:00
decaffeinate
a397154e18 decaffeinate: Run post-processing cleanups on AuthorizationManager.coffee and 18 other files 2020-06-23 18:29:38 +01:00
decaffeinate
7335084c26 decaffeinate: Convert AuthorizationManager.coffee and 18 other files to JS 2020-06-23 18:29:34 +01:00
decaffeinate
90eafa388a decaffeinate: Rename AuthorizationManager.coffee and 18 other files from .coffee to .js 2020-06-23 18:29:29 +01:00
decaffeinate
20bb3540e7 decaffeinate: update .gitignore 2020-06-23 18:29:21 +01:00
decaffeinate
59083edb9e decaffeinate: update build scripts to es 2020-06-23 18:29:17 +01:00
Jakob Ackermann
8ac973e767 [misc] help prettier/decaffeinate with scoping a comment into a fn body 2020-06-23 18:04:09 +01:00
Jakob Ackermann
205efa8812 [WebsocketController] reset the client context before (re)populating it
Co-Authored-By: Brian Gough <brian.gough@overleaf.com>
2020-06-22 17:04:31 +01:00
Jakob Ackermann
1fcf534dcf [Router] revert preserving of client.ol_context
We do not enter this line twice, it would result in multiple event
 handlers too.
2020-06-22 17:04:31 +01:00
Jakob Ackermann
d17ef183d0 [Router] gracefully set and do not reset the ol_context 2020-06-22 17:04:30 +01:00
Jakob Ackermann
ce4f9148c3 [perf] WebsocketLoadBalancer: move back to a sync loop for msg fan out 2020-06-22 17:04:15 +01:00
Jakob Ackermann
a70c1e1fa2 [perf] WebsocketLoadBalancer: check is_restricted_message once
...and filter clients early on.
2020-06-22 17:04:15 +01:00
Jakob Ackermann
5282f8f531 [misc] synchronous client store using an Object at .ol_context 2020-06-22 17:04:08 +01:00
Miguel Serrano
f2cae26166 Merge pull request #157 from overleaf/msm-update-deps
Update Dependencies
2020-06-22 15:45:11 +02:00
Miguel Serrano
3ffc218b2c Rolled back redis-sharelatex to 1.0.12 2020-06-22 13:13:44 +02:00
Miguel Serrano
ce3266c59c Fixed sha downgrades 2020-06-19 17:29:31 +02:00
Miguel Serrano
1e1f6ca19f Updated 'uid-safe' and minor/patch dependencies 2020-06-19 16:26:32 +02:00
Jakob Ackermann
5f7841526f [misc] RoomManager: emitOnCompletion: properly handle Promise rejections
```
result = Promise.all([<Promise that rejects eventually>]) # rejection 1
result.then () -> RoomEvents.emit(eventName)              # rejection 2
result.catch (err) -> RoomEvents.emit(eventName, err)     # handle r1
```
As shown above, the second rejection remains unhandled. The fix is to
 chain the `.catch()` onto the `.then()` Promise.
2020-06-17 09:29:12 +01:00
Jakob Ackermann
06a8dc8ec1 Merge pull request #155 from overleaf/jpa-backport-receiveupdate-tests
[backport] 107 and 116: Improve ReceiveUpdate acceptance tests
2020-06-10 11:28:25 +02:00
Jakob Ackermann
10eb30e572 Merge pull request #154 from overleaf/jpa-backport-httpcontroller-tests
[backport] 111 HttpController: 404 for missing clients and add tests
2020-06-10 11:28:17 +02:00
Jakob Ackermann
45ac2bdd97 Merge pull request #153 from overleaf/jpa-backport-drainmanager-tests
[backport] 108 and 112: DrainManager acceptance tests
2020-06-10 11:28:08 +02:00
Jakob Ackermann
cfe37dcbb5 Merge pull request #152 from overleaf/jpa-vendor-cookie
[misc] vendor a patched session.socket.io middleware
2020-06-10 11:27:58 +02:00
Jakob Ackermann
5b85e0154d Merge pull request #151 from overleaf/jpa-perf-parser
[perf] add a few short cuts to the packet decoding
2020-06-10 11:27:50 +02:00
Jakob Ackermann
b2e4448992 [misc] test/acceptance: ReceiveUpdateTests: test remotely sent update 2020-06-10 09:53:48 +01:00
Jakob Ackermann
83e3ff0ed7 [misc] test/acceptance: ReceiveUpdateTests: add 2nd project/3rd client
...and check for cross project leakage.
2020-06-10 09:53:29 +01:00
Jakob Ackermann
56fda1f9b0 [misc] test/acceptance: use the correct redis instances 2020-06-10 09:43:15 +01:00
Jakob Ackermann
bc44494466 [HttpController] return 404 in case of a missing client and add tests
Add acceptance tests for the client view.
2020-06-10 09:41:36 +01:00
Jakob Ackermann
eabff1d6b2 [perf] test/acceptance: DrainManagerTests: cleanup previous clients
...before starting to drain.
2020-06-09 18:02:38 +01:00
Jakob Ackermann
de35fc5ecf [HttpApiController] implement the disconnection of a single client
The http route returns as soon as the client has fully disconnected.
2020-06-09 18:01:08 +01:00
Jakob Ackermann
91e296533f [misc] test/acceptance: add tests for the draining of connections 2020-06-09 18:00:44 +01:00
Jakob Ackermann
acb7d7df5a [misc] add test cases for the validation of the callback argument
When the user provides a function as last argument for socket.emit,
 socket.io will flag this as an RPC and add a cb as the last argument
 to the client.on('event', ...) handler on the server side.
Without a function as last argument for socket.emit, the callback
 argument on the server side is undefined, leading to invalid function
 calls (`undefined()`) and an unhandled exception.
The user can also provide lots of other arguments, so the 2nd/3rd ...
 argument is of arbitrary type, again leading to invalid function calls
 -- e.g. `1()`.
2020-06-09 16:30:03 +01:00
Jakob Ackermann
853ee994a6 [perf] add a few short cuts to the packet decoding 2020-06-09 15:26:17 +01:00
Jakob Ackermann
dc553c4150 [misc] vendor a patched session.socket.io middleware 2020-06-09 15:21:33 +01:00
Jakob Ackermann
1c9eaf574a Merge pull request #147 from overleaf/jpa-backport-141
[backport] 141: Router: validate the callback argument
2020-06-09 14:41:24 +02:00
Jakob Ackermann
5238e6ad36 Merge pull request #145 from overleaf/jpa-backport-140
[backport] 140: stop processing requests as we detect a client disconnect
2020-06-09 14:41:12 +02:00
Jakob Ackermann
589bedc3dd Merge pull request #146 from overleaf/jpa-downgrade-logging
[misc] downgrade logging when running tests
2020-06-09 14:40:59 +02:00
Jakob Ackermann
32af7001fc [misc] Router: prefix the publicId with 'P.' for easy differentiation 2020-06-08 11:29:40 +01:00
Jakob Ackermann
f40241a037 [misc] downgrade logging when running tests 2020-06-05 11:38:09 +01:00
Jakob Ackermann
0b2cccf1e0 [misc] apply review feedback: adjust metric names
Co-Authored-By: Brian Gough <brian.gough@overleaf.com>

(cherry-picked from commit 67674b83efb452ece05cdc39525ee3a5eeb8a4d7)
2020-06-05 11:33:00 +01:00
Jakob Ackermann
ddcb9cf8c8 [misc] downgrade a warning message from clients leaving non-joined rooms
This can now happen all the time, as we skip the join for clients that
 disconnect before joinProject/joinDoc completed.

(cherry-picked from commit f357931de74e088800f3cced3898cce4f251dad0)
2020-06-05 11:32:43 +01:00
Jakob Ackermann
7fa9061015 [misc] stop processing requests as we detect a client disconnect
v2 expose `client.connected`; v0 exposes `client.disconnected`

(cherry-picked from commit a9d70484343ca9be367d45bf7bb949e4be449647)
2020-06-05 11:32:13 +01:00
Jakob Ackermann
0840700ffd [Router] validate the callback argument 2020-06-05 10:59:01 +01:00
Jakob Ackermann
c6d08647c7 [misc] socket.io: use a secondary publicId for public facing usages 2020-06-04 17:18:07 +01:00