Skip to content

perf: remove unnecessary routes from middleware #21089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented May 2, 2025

What does this PR do?

  • Previously, we have a catch-all clause in config.matcher in middleware, causing all requests to go through middleware, and hence we had to maintain a whitelist array to allow POST requests to some page routes. Since we removed the catch-all clause from config.matcher, we can remove unnecessary app routes from the middleware and reduce # of edge requests

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

@hbjORbj hbjORbj requested a review from a team as a code owner May 2, 2025 19:43
@graphite-app graphite-app bot requested a review from a team May 2, 2025 19:43
@keithwillcode keithwillcode added core area: core, team members only foundation labels May 2, 2025
@dosubot dosubot bot added the performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive label May 2, 2025
Comment on lines -194 to -198
// Routes allowed for POST method (matching `POST_METHODS_ALLOWED_APP_ROUTES` array)
"/settings/my-account/general",
"/settings/developer/webhooks",
"/settings/developer/api-keys",
"/teams",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simply remove these routes from config.matcher and not need to maintain POST_METHODS_ALLOWED_APP_ROUTES array

Copy link

graphite-app bot commented May 2, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (05/02/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link

@mrge-io mrge-io bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mrge reviewed 1 file and found no issues. Review this PR in mrge.io.

Copy link

vercel bot commented May 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview May 2, 2025 7:56pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 2, 2025 7:56pm

Copy link
Contributor

github-actions bot commented May 2, 2025

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only foundation performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants