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

Improve robustness of request construction #600

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

sholladay
Copy link
Collaborator

@sholladay sholladay commented Jun 26, 2024

Fixes #507

This PR aims to reduce the likelihood that the user provided request options will be clobbered or ignored as a result of how we construct requests. Copying requests is necessary in some cases, but it's risky as the API is error-prone and so it is best avoided when possible.

Additionally, this PR fixes the root cause of flakiness in the retry tests and re-enables concurrent tests. The performance observers used previously were returning bogus data. Somehow they were caching measurements and returning identical measurement data between completely separate tests and observer instances. Really bizarre. Luckily, we can achieve exactly the same thing and more reliably with even simpler code by just comparing two calls to performance.now()!

@sholladay sholladay merged commit 974f1e9 into sindresorhus:main Jun 26, 2024
1 check passed
@sholladay sholladay deleted the fewer-request-copies branch June 26, 2024 07:19
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.

Options are overwritten if json option is used
1 participant