matrix-public-archive/server/lib
Eric Eastwood 9078abf4f1
Timeout requests and stop processing further (#204)
Fix https://github.com/matrix-org/matrix-public-archive/issues/148
Fix https://github.com/matrix-org/matrix-public-archive/issues/40

 - Apply timeout middleware to all room directory and room routes
 - Stop messing with the response after we timeout. Fix https://github.com/matrix-org/matrix-public-archive/issues/148
    - This also involves cancelling any `async/await` things like requests in the routes so we throw an abort error instead of continuing on. Fix https://github.com/matrix-org/matrix-public-archive/issues/40
 - Also abort the route if we see that the user closed the request before we could respond to them
 - Bumps minimum supported Node.js version to v18 because we're now using the built-in native `fetch` in Node.js vs `node-fetch`. This gives us the custom `signal.reason` that we aborted with instead of a generic `AbortError`.
    - This also means we had to add some instrumentation for `fetch` which uses `undici` under the hood. Settled on some unofficial instrumentation: [`opentelemetry-instrumentation-fetch-node`](https://www.npmjs.com/package/opentelemetry-instrumentation-fetch-node)
2023-05-02 00:39:01 -05:00
..
errors Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
matrix-utils Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
config.js Use JSON5 for configuration files with comments (#52) 2022-08-29 20:33:02 -05:00
express-async-handler.js Fix lints 2022-02-15 21:33:31 -06:00
fetch-endpoint.js Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
get-dependencies-for-entry-point-name.js Cache derived info from the `manifest.json` (#191) 2023-04-26 17:04:49 -05:00
get-favicon-asset-urls.js Cache derived info from the `manifest.json` (#191) 2023-04-26 17:04:49 -05:00
get-version-tags.js Production ready build (#175) 2023-04-24 23:50:53 -05:00
parse-via-servers-from-user-input.js Timeout requests and stop processing further (#204) 2023-05-02 00:39:01 -05:00
safe-json.js OpenTelemetry tracing so we can see spans where the app is taking time (#27) 2022-07-14 11:08:50 -05:00
sanitize-html.js OpenTelemetry tracing so we can see spans where the app is taking time (#27) 2022-07-14 11:08:50 -05:00
set-headers-to-preload-assets.js Preload fonts and images (#187) 2023-04-26 16:35:00 -05:00