Skip to content

test: stop the mock server sharing _links between concurrent requests - #263

Merged
brettflorio merged 1 commit into
mainfrom
routine/fx-287-20260908-123208
Sep 10, 2026
Merged

test: stop the mock server sharing _links between concurrent requests#263
brettflorio merged 1 commit into
mainfrom
routine/fx-287-20260908-123208

Conversation

@pheekus

@pheekus pheekus commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

createResourceGetHandler wrote _links onto the dataset entry itself, then awaited addEmbeds before serializing. A second GET for the same resource could overwrite the first one's _links while the first was still resolving embeds, so both responses came back with the last writer's self href. The fix writes _links and _embedded onto a shallow copy instead.

FX-287

The resource GET handler wrote `_links` onto the dataset entry itself and
then awaited `addEmbeds` before serializing, so a second GET for the same
resource could overwrite the first one's `_links` while the first was still
resolving embeds. Both responses then carried the last writer's `self`
href. The same sharing also left `_embedded` from a zoomed request on later
unzoomed ones, which needs no race at all. Write both onto a copy instead.

`src/server` had no test group, and the config has no top-level `files`
key, so a test placed there was silently never run. The generator now emits
one group for it.

npx wtr --group server
@pheekus pheekus changed the title fix: stop the mock server sharing _links between concurrent requests test: stop the mock server sharing _links between concurrent requests Sep 8, 2026
@pheekus
pheekus force-pushed the routine/fx-287-20260908-123208 branch from 68b5344 to aedddb5 Compare September 8, 2026 16:28
@pheekus pheekus self-assigned this Sep 8, 2026
@pheekus
pheekus requested a review from brettflorio September 8, 2026 16:34
@brettflorio
brettflorio disabled the stack merge September 9, 2026 19:48
Base automatically changed from routine/elements-v1-green-20260908-104950 to main September 9, 2026 19:49
@brettflorio
brettflorio merged commit 75b187c into main Sep 10, 2026
9 checks passed
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