Skip to content
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

Fix race condition in devserver #2213

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Fix race condition in devserver #2213

merged 1 commit into from
Jan 19, 2024

Conversation

nmattia
Copy link
Collaborator

@nmattia nmattia commented Jan 19, 2024

The devserver handles proxying requests to canisters. The previous implementation used a single http-proxy Proxy object, where the handlers were rewritten for each new async request.

The caused issues with concurrent request, where a new request might set up new handlers for an in-flight request.

This drops the dependency on http-proxy and instead proxies the request using undici (existing transivite dep through Vite).

The forwarding code is also moved to the utils module.

The devserver handles proxying requests to canisters. The previous
implementation used a single `http-proxy` Proxy object, where the
handlers were rewritten for each new async request.

The caused issues with concurrent request, where a new request might set
up new handlers for an in-flight request.

This drops the dependency on `http-proxy` and instead proxies the
request using `undici` (existing transivite dep through Vite).

The forwarding code is also moved to the utils module.
Copy link
Member

@frederikrothenberger frederikrothenberger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for fixing it!

@nmattia nmattia merged commit 4e32d44 into main Jan 19, 2024
57 checks passed
@nmattia nmattia deleted the nm-fix-proxy branch January 19, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants