You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the middleware chain in ./server/app.js we check if the maintenance mode flag is on quite early but send a 503 to the user as the last step before hitting any of the defined routes. Between checking the flag and sending the 503 we have 10 other pieces of middleware for various things, 6 of them check the state of that flag and just call next() if it's on, 1 of them checks but some of the code is run regardless of the flag’s state, and 3 seem to not care about it’s state.
I wonder whether we should bail earl and send the 503 straight away? Unless any of the code that doesn’t check really needs to run regardless, I propose combining the ./server/middleware/route-maintenance-mode code and ./server/middleware/flag-maintenance-mode code and sending the 503 straight away not bothering to run any of it.
Middleware that checks the flag and does nothing if true:
./server/middleware/db
./server/middleware/expedite-user-auth
./server/middleware/get-user-access-auth-token
./server/middleware/get-user-profile
./server/middleware/get-contract-by-id
./server/middleware/check-if-new-syndication-user
Middleware that checks the flag but has other code that doesn’t check:
In the middleware chain in
./server/app.js
we check if the maintenance mode flag is on quite early but send a 503 to the user as the last step before hitting any of the defined routes. Between checking the flag and sending the 503 we have 10 other pieces of middleware for various things, 6 of them check the state of that flag and just callnext()
if it's on, 1 of them checks but some of the code is run regardless of the flag’s state, and 3 seem to not care about it’s state.I wonder whether we should bail earl and send the 503 straight away? Unless any of the code that doesn’t check really needs to run regardless, I propose combining the
./server/middleware/route-maintenance-mode
code and./server/middleware/flag-maintenance-mode
code and sending the 503 straight away not bothering to run any of it.Middleware that checks the flag and does nothing if true:
./server/middleware/db
./server/middleware/expedite-user-auth
./server/middleware/get-user-access-auth-token
./server/middleware/get-user-profile
./server/middleware/get-contract-by-id
./server/middleware/check-if-new-syndication-user
Middleware that checks the flag but has other code that doesn’t check:
./server/middleware/is-syndication-user
Middleware that doesn’t check at all:
./server/middleware/decode-session
./server/middleware/masquerade
./server/middleware/get-syndication-licence-for-user
The text was updated successfully, but these errors were encountered: