handlePatchAccessibility does a transactional read-then-upsert (cmd/api/main.go:208-239). There is no test verifying behavior under concurrent writes — two simultaneous PATCHes against the same place could in theory both take the create branch.
Suggested test
- Create a place with no accessibility profile.
- Fire N concurrent PATCH requests against
/places/{id}/accessibility with different OverallStatus values.
- Assert: exactly one row exists in
accessibility_profiles for that place; the final stored value matches one of the inputs; no errors return 500.
- Run with
-race to catch any data races on shared state in the handler/server.
- File: extend
cmd/api/integration_test.go.
handlePatchAccessibilitydoes a transactional read-then-upsert (cmd/api/main.go:208-239). There is no test verifying behavior under concurrent writes — two simultaneous PATCHes against the same place could in theory both take the create branch.Suggested test
/places/{id}/accessibilitywith differentOverallStatusvalues.accessibility_profilesfor that place; the final stored value matches one of the inputs; no errors return 500.-raceto catch any data races on shared state in the handler/server.cmd/api/integration_test.go.