Skip to content

fix: race condition in resolvedPathname#15506

Draft
ascorbic wants to merge 1 commit intomainfrom
resolve-path-race
Draft

fix: race condition in resolvedPathname#15506
ascorbic wants to merge 1 commit intomainfrom
resolve-path-race

Conversation

@ascorbic
Copy link
Contributor

Changes

Fixes a race condition in the dev server that could cause TypeError: Missing parameter errors when handling concurrent requests to dynamic routes.

The resolvedPathname was stored as shared instance state on AstroServerApp and DevApp, so concurrent requests could overwrite each other's pathname, causing a mismatch between the matched route and the pathname used to extract params.

This PR changes it to use a local variable per-request.

Claude was involved in the diagnosis of this bug and the creaiton of the fix.

Testing

Added a test

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: 4092385

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 13, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will improve performance by 12.16%

⚡ 1 improved benchmark
✅ 8 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation Build: hybrid site (static + server) 8.6 s 7.7 s +12.16%

Comparing resolve-path-race (4092385) with main (6c60b05)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (4c9f918) during the generation of this report, so 6c60b05 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ascorbic ascorbic marked this pull request as draft February 13, 2026 20:30
@ascorbic ascorbic force-pushed the resolve-path-race branch 2 times, most recently from ac633da to 9bd2e2c Compare February 13, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments