test: stop the mock server sharing _links between concurrent requests - #263
Merged
Conversation
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
force-pushed
the
routine/fx-287-20260908-123208
branch
from
September 8, 2026 16:28
68b5344 to
aedddb5
Compare
brettflorio
approved these changes
Sep 8, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createResourceGetHandlerwrote_linksonto the dataset entry itself, then awaitedaddEmbedsbefore serializing. A second GET for the same resource could overwrite the first one's_linkswhile the first was still resolving embeds, so both responses came back with the last writer'sselfhref. The fix writes_linksand_embeddedonto a shallow copy instead.